Autocomplete unknown value in set filetype ...

`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.
This commit is contained in:
Dmytro Maluka 2024-03-24 22:32:30 +01:00
parent c2c2b2addf
commit ee6519f5cb

View File

@ -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]