From 3e8d5c038e3dc690445b9cefdf4c440c793a7a1f Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Mon, 27 Mar 2023 18:50:06 -0700 Subject: [PATCH] Consistently use the colon prefix for Ex commands --- autoload/lsp/callhierarchy.vim | 18 +++++++++--------- autoload/lsp/completion.vim | 2 +- autoload/lsp/diag.vim | 8 ++++---- autoload/lsp/hover.vim | 6 +++--- autoload/lsp/lsp.vim | 6 +++--- autoload/lsp/outline.vim | 4 ++-- autoload/lsp/signature.vim | 14 +++++++------- autoload/lsp/symbol.vim | 14 +++++++------- autoload/lsp/typehierarchy.vim | 2 +- autoload/lsp/util.vim | 2 +- 10 files changed, 38 insertions(+), 38 deletions(-) diff --git a/autoload/lsp/callhierarchy.vim b/autoload/lsp/callhierarchy.vim index f0bce56..6e57571 100644 --- a/autoload/lsp/callhierarchy.vim +++ b/autoload/lsp/callhierarchy.vim @@ -132,15 +132,15 @@ def CallHierarchyTreeShow(incoming: bool, prepareItem: dict, :setlocal nonumber nornu :setlocal fdc=0 signcolumn=no - nnoremap CallHierarchyItemJump() - nnoremap - CallHierarchyTreeItemOpen() - nnoremap + CallHierarchyTreeItemClose() - command -buffer LspCallHierarchyRefresh CallHierarchyTreeRefreshCmd() - command -buffer LspCallHierarchyIncoming CallHierarchyTreeIncomingCmd() - command -buffer LspCallHierarchyOutgoing CallHierarchyTreeOutgoingCmd() - - syntax match Comment '^#.*$' - syntax match Directory '(.*)$' + :nnoremap CallHierarchyItemJump() + :nnoremap - CallHierarchyTreeItemOpen() + :nnoremap + CallHierarchyTreeItemClose() + :command -buffer LspCallHierarchyRefresh CallHierarchyTreeRefreshCmd() + :command -buffer LspCallHierarchyIncoming CallHierarchyTreeIncomingCmd() + :command -buffer LspCallHierarchyOutgoing CallHierarchyTreeOutgoingCmd() + + :syntax match Comment '^#.*$' + :syntax match Directory '(.*)$' endif w:LspBufnr = save_bufnr diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index 8486733..cb84cf0 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -494,7 +494,7 @@ export def BufferInit(lspserver: dict, bnr: number, ftype: string) endif # in insert mode stops completion and inserts a if !opt.lspOptions.noNewlineInCompletion - inoremap pumvisible() ? "\\" : "\" + :inoremap pumvisible() ? "\\" : "\" endif else if LspOmniComplEnabled(ftype) diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index b4c72e6..c0ebade 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -123,7 +123,7 @@ export def DiagNotification(lspserver: dict, uri: string, diags: list User LspDiagsUpdated + :doautocmd User LspDiagsUpdated endif enddef @@ -276,7 +276,7 @@ def DisplayDiag(diag: dict) ShowDiagInPopup(diag) else # Display the diagnostic message in the status message area - echo diag.message + :echo diag.message endif enddef @@ -307,9 +307,9 @@ export def ShowCurrentDiagInStatusLine(lspserver: dict) code = $'[{diag.code}] ' endif var msgNoLineBreak = code .. substitute(substitute(diag.message, "\n", ' ', ''), "\\n", ' ', '') - echo msgNoLineBreak[ : max_width] + :echo msgNoLineBreak[ : max_width] else - echo '' + :echo '' endif enddef diff --git a/autoload/lsp/hover.vim b/autoload/lsp/hover.vim index fa7a5be..d429ffa 100644 --- a/autoload/lsp/hover.vim +++ b/autoload/lsp/hover.vim @@ -64,15 +64,15 @@ export def HoverReply(lspserver: dict, hoverResult: any): void endif if opt.lspOptions.hoverInPreview - silent! pedit LspHoverReply - wincmd P + :silent! pedit LspHoverReply + :wincmd P :setlocal buftype=nofile :setlocal bufhidden=delete bufnr()->deletebufline(1, '$') hoverText->append(0) [1, 1]->cursor() exe $'setlocal ft={hoverKind}' - wincmd p + :wincmd p else var winid = hoverText->popup_atcursor({moved: 'word', maxwidth: 80, diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index c6fc4b2..9347a03 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -765,7 +765,7 @@ export def Rename(a_newName: string) endif # clear the input prompt - echo "\r" + :echo "\r" endif lspserver.renameSymbol(newName) @@ -798,7 +798,7 @@ export def SymbolSearch(queryArg: string) return endif endif - redraw! + :redraw! lspserver.workspaceQuery(query) enddef @@ -810,7 +810,7 @@ export def ListWorkspaceFolders() return endif - echomsg $'Workspace Folders: {lspserver.workspaceFolders->string()}' + :echomsg $'Workspace Folders: {lspserver.workspaceFolders->string()}' enddef # Add a workspace folder. Default is to use the current folder. diff --git a/autoload/lsp/outline.vim b/autoload/lsp/outline.vim index f36c280..266fc55 100644 --- a/autoload/lsp/outline.vim +++ b/autoload/lsp/outline.vim @@ -255,8 +255,8 @@ export def OpenOutlineWindow() :syntax keyword LSPTitle EnumMember Struct Event Operator TypeParameter if str2nr(&t_Co) > 2 - highlight clear LSPTitle - highlight default link LSPTitle Title + :highlight clear LSPTitle + :highlight default link LSPTitle Title endif prop_type_add('LspOutlineHighlight', {bufnr: bufnr(), highlight: 'Search', override: true}) diff --git a/autoload/lsp/signature.vim b/autoload/lsp/signature.vim index 1d8f447..590718f 100644 --- a/autoload/lsp/signature.vim +++ b/autoload/lsp/signature.vim @@ -73,13 +73,13 @@ export def SignatureHelp(lspserver: dict, sighelp: any): void endif endif if opt.lspOptions.echoSignature - echon "\r\r" - echon '' - echon text->strpart(0, startcol) - echoh LineNr - echon text->strpart(startcol, hllen) - echoh None - echon text->strpart(startcol + hllen) + :echon "\r\r" + :echon '' + :echon text->strpart(0, startcol) + :echoh LineNr + :echon text->strpart(startcol, hllen) + :echoh None + :echon text->strpart(startcol + hllen) else # Close the previous signature popup and open a new one lspserver.signaturePopup->popup_close() diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim index 74fed32..db0b590 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -58,7 +58,7 @@ def FilterSymbols(lspserver: dict, popupID: number, key: string): bool else []->setwinvar(popupID, 'LspSymbolTable') endif - echo $'Symbol: {query}' + :echo $'Symbol: {query}' endif # Update the workspace symbol query string @@ -74,7 +74,7 @@ enddef # Jump to the location of a symbol selected in the popup menu def JumpToWorkspaceSymbol(popupID: number, result: number): void # clear the message displayed at the command-line - echo '' + :echo '' if result <= 0 # popup is canceled @@ -114,7 +114,7 @@ def JumpToWorkspaceSymbol(popupID: number, result: number): void endif # Set the previous cursor location mark. Instead of using setpos(), m' is # used so that the current location is added to the jump list. - normal m' + :normal m' setcursorcharpos(symTbl[result - 1].pos.line + 1, symTbl[result - 1].pos.character + 1) catch @@ -147,7 +147,7 @@ def ShowSymbolMenu(lspserver: dict, query: string) prop_type_add('lspworkspacesymbol', {bufnr: lspserver.workspaceSymbolPopup->winbufnr(), highlight: 'Title'}) - echo $'Symbol: {query}' + :echo $'Symbol: {query}' enddef # Convert a file name to () format. @@ -260,9 +260,9 @@ def UpdatePeekFilePopup(lspserver: dict, locations: list>) lspserver.peekSymbolFilePopup = popup_create(bnr, popupAttrs) var cmds =<< trim eval END - setlocal number + :setlocal number [{range.start.line + 1}, 1]->cursor() - normal! z. + :normal! z. END win_execute(lspserver.peekSymbolFilePopup, cmds) @@ -441,7 +441,7 @@ def PeekSymbolLocation(lspserver: dict, location: dict) matchaddpos('Search', [pos], 10, 101, {window: pwid}) var cmds =<< trim eval END [{range.start.line + 1}, 1]->cursor() - normal! z. + :normal! z. END win_execute(pwid, cmds, 'silent!') enddef diff --git a/autoload/lsp/typehierarchy.vim b/autoload/lsp/typehierarchy.vim index d4048e6..67c4965 100644 --- a/autoload/lsp/typehierarchy.vim +++ b/autoload/lsp/typehierarchy.vim @@ -87,7 +87,7 @@ def UpdateTypeHierFileInPopup(lspserver: dict, typeUriMap: list>) lspserver.typeHierFilePopup = popup_create(bnr, popupAttrs) var cmds =<< trim eval END [{typeUriMap[n].range.start.line + 1}, 1]->cursor() - normal! z. + :normal! z. END win_execute(lspserver.typeHierFilePopup, cmds) diff --git a/autoload/lsp/util.vim b/autoload/lsp/util.vim index 9343d4e..f9e73f6 100644 --- a/autoload/lsp/util.vim +++ b/autoload/lsp/util.vim @@ -175,7 +175,7 @@ export def JumpToLspLocation(location: dict, cmdmods: string) if bnr == bufnr() # Set the previous cursor location mark. Instead of using setpos(), m' is # used so that the current location is added to the jump list. - normal m' + :normal m' else var wid = fname->bufwinid() if wid != -1 -- 2.48.1