From ee6519f5cbe5f072c7a4f3a229281d9d52424b25 Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Sun, 24 Mar 2024 22:32:30 +0100 Subject: [PATCH] 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. --- internal/action/infocomplete.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/action/infocomplete.go b/internal/action/infocomplete.go index ee2e27e7..67b6671c 100644 --- a/internal/action/infocomplete.go +++ b/internal/action/infocomplete.go @@ -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]