From 2d396a46141f03e867db07f93a29fae602eb3e76 Mon Sep 17 00:00:00 2001 From: mityu Date: Sat, 14 Dec 2024 01:50:48 +0900 Subject: [PATCH] fix: command-line completion of LspInstallServer In cmdwin, LspInstallServer's completion always returns LSP(s) for Vim script regardless of the current buffer's filetype. --- autoload/lsp_settings.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index 75da49db..b4f679a7 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -328,7 +328,8 @@ endfunction function! lsp_settings#complete_install(arglead, cmdline, cursorpos) abort let l:installers = [] - for l:ft in split(&filetype . '.', '\.', 1) + let l:filetype = getcmdwintype() !=# '' && getcmdtype() ==# '' ? getbufvar('#', '&filetype') : &filetype + for l:ft in split(l:filetype . '.', '\.', 1) let l:ft = tolower(empty(l:ft) ? '_' : l:ft) if !has_key(s:settings, l:ft) continue