diff --git a/autoload/lsp/signature.vim b/autoload/lsp/signature.vim index 0b229b9a..59fbc085 100644 --- a/autoload/lsp/signature.vim +++ b/autoload/lsp/signature.vim @@ -109,7 +109,7 @@ export def SignatureHelp(lspserver: dict, sighelp: any): void # 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 7d26df82..bcd547a3 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -802,7 +802,7 @@ enddef # 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 @@ def SymbolMenuFilterKey(symPopupMenu: number, # 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 6d4c58c0..68e4861a 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -773,10 +773,13 @@ can map these commands to keys and make it easier to invoke them. 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