Skip to content

Commit

Permalink
Autocomplete unknown value in set filetype ...
Browse files Browse the repository at this point in the history
`unknown` is a valid value for the `filetype` option (and executing
`set filetype unknown` does what is expected: it forces filetype
autodetection). So let's add `unknown` to the autocomplete suggestions
for `filetype`, along with actual filetypes.
  • Loading branch information
dmaluka committed Mar 24, 2024
1 parent c2c2b2a commit ee6519f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/action/infocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ func filetypeComplete(input string) (string, []string) {
}
}

if strings.HasPrefix("unknown", input) {
suggestions = append(suggestions, "unknown")
}

var chosen string
if len(suggestions) == 1 {
chosen = suggestions[0]
Expand Down

0 comments on commit ee6519f

Please sign in to comment.