autoload/lsp/signature.vim | 2 +- autoload/lsp/symbol.vim | 41 ++++++++++++++++++++++++++++------------- doc/lsp.txt | 11 +++++++---- diff --git a/autoload/lsp/signature.vim b/autoload/lsp/signature.vim index 0b229b9a0d62f79bfd81cc04d4580b3f45ed9b85..59fbc0856a775c263bf7ed20dc221b0b142015bc 100644 --- a/autoload/lsp/signature.vim +++ b/autoload/lsp/signature.vim @@ -109,7 +109,7 @@ else # Close the previous signature popup and open a new one lspserver.signaturePopup->popup_close() - var popupID = text->popup_atcursor({moved: [col('.') - 1, 9999999]}) + var popupID = text->popup_atcursor({padding: [0, 1, 0, 1], moved: [col('.') - 1, 9999999]}) var bnr: number = popupID->winbufnr() prop_type_add('signature', {bufnr: bnr, highlight: 'LspSigActiveParameter'}) if hllen > 0 diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim index 7d26df82a3f6bc8ab28e2a8e35f5eb48e411a607..bcd547a33200419de42352aa6e27c427aa5b1d16 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -802,7 +802,7 @@ # Key filter function for the symbol popup menu. def SymbolMenuFilterKey(symPopupMenu: number, key: string): bool - var keyHandled = false + var keyHandled = true var updateInputPopup = false var inputText = symPopupMenu->getwinvar('inputText', '') var symInputPopup = symPopupMenu->getwinvar('symbolInputPopup', 0) @@ -811,33 +811,48 @@ if key == "\" || key == "\" # Erase a character in the input popup if inputText->len() >= 1 inputText = inputText[: -2] - keyHandled = true updateInputPopup = true + else + keyHandled = false endif elseif key == "\" # Erase all the characters in the input popup inputText = '' - keyHandled = true updateInputPopup = true + elseif key == "\" + || key == "\" + || key == "\" + || key == "\" + var ln = getcurpos(symPopupMenu)[1] + win_execute(symPopupMenu, "normal! j") + if ln == getcurpos(symPopupMenu)[1] + win_execute(symPopupMenu, "normal! gg") + endif + elseif key == "\" + || key == "\" + || key == "\" + || key == "\" + var ln = getcurpos(symPopupMenu)[1] + win_execute(symPopupMenu, "normal! k") + if ln == getcurpos(symPopupMenu)[1] + win_execute(symPopupMenu, "normal! G") + endif + elseif key == "\" + win_execute(symPopupMenu, "normal! \") + elseif key == "\" + win_execute(symPopupMenu, "normal! \") elseif key == "\" || key == "\" - || key == "\" - || key == "\" || key == "\" || key == "\" - || key == "\" - || key == "\" - # scroll the symbol popup window - var cmd: string = 'normal! ' .. (key == "\" ? 'j' : - key == "\" ? 'k' : key) - win_execute(symPopupMenu, cmd) - keyHandled = true + win_execute(symPopupMenu, $"normal! {key}") elseif key =~ '^\k$' # A keyword character is typed. Add to the input text and update the # popup inputText ..= key - keyHandled = true updateInputPopup = true + else + keyHandled = false endif var symTblFiltered: list> = [] diff --git a/doc/lsp.txt b/doc/lsp.txt index 6d4c58c011b09a754d2d6254f158e4ffcb11dc84..68e4861abbbd632d72209d668c06e5b24573de9e 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -773,10 +773,13 @@ menu. When a symbol is selected in the popup menu by pressing or , jump to the location of the symbol. - The , , , , , , - , , , keys can be used to - scroll the popup menu. The or keys can - be used to cancel the popup menu. + The , , , , , , + , ScrollWheelDown> keys can be used to + scroll popup menu one item at a time. and + can be used to scroll a page of popup + window, while and can be used to scroll a + page of underlying window. The or keys + can be used to cancel the popup menu. If one or more keyword characters are typed, then only the symbols containing the keyword characters are