From d7d29b63960f4f591068f6f67230c9e8740e053c Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 18 Jun 2023 07:26:50 -0700 Subject: [PATCH] Silence the messages when loading new buffers --- autoload/lsp/diag.vim | 2 +- autoload/lsp/offset.vim | 8 ++++---- autoload/lsp/symbol.vim | 6 +++--- autoload/lsp/textedit.vim | 2 +- autoload/lsp/util.vim | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 7b6f828..30b1b7d 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -163,7 +163,7 @@ enddef # Refresh the placed diagnostics in buffer "bnr" # This inline signs, inline props, and virtual text diagnostics def DiagsRefresh(bnr: number) - bnr->bufload() + :silent! bnr->bufload() RemoveDiagVisualsForBuffer(bnr) diff --git a/autoload/lsp/offset.vim b/autoload/lsp/offset.vim index b6bbe38..699964e 100644 --- a/autoload/lsp/offset.vim +++ b/autoload/lsp/offset.vim @@ -19,9 +19,9 @@ export def EncodePosition(lspserver: dict, bnr: number, pos: dict) return endif - bnr->bufload() + :silent! bnr->bufload() var text = bnr->getbufline(pos.line + 1)->get(0, '') - if text == '' + if text->empty() return endif @@ -45,10 +45,10 @@ export def DecodePosition(lspserver: dict, bnr: number, pos: dict) return endif - bnr->bufload() + :silent! bnr->bufload() var text = bnr->getbufline(pos.line + 1)->get(0, '') # If the line is empty then don't decode the character position. - if text == '' + if text->empty() return endif diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim index 081af96..b26057c 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -352,7 +352,7 @@ def PeekLocations(lspserver: dict, locations: list>, if bnr == -1 bnr = fname->bufadd() endif - bnr->bufload() + :silent! bnr->bufload() var lnum = range.start.line + 1 var text: string = bnr->getbufline(lnum)->get(0, '') @@ -394,7 +394,7 @@ export def ShowLocations(lspserver: dict, locations: list>, if bnr == -1 bnr = fname->bufadd() endif - bnr->bufload() + :silent! bnr->bufload() var text: string = bnr->getbufline(range.start.line + 1)->get(0, '')->trim("\t ", 1) qflist->add({filename: fname, lnum: range.start.line + 1, @@ -441,7 +441,7 @@ def PeekSymbolLocation(lspserver: dict, location: dict) # Failed to create or find a buffer return endif - silent! bnum->bufload() + :silent! bnum->bufload() if lspserver.peekSymbolPopup->winbufnr() != -1 # If the symbol popup window is already present, close it. diff --git a/autoload/lsp/textedit.vim b/autoload/lsp/textedit.vim index 00c0172..5c11408 100644 --- a/autoload/lsp/textedit.vim +++ b/autoload/lsp/textedit.vim @@ -104,7 +104,7 @@ export def ApplyTextEdits(bnr: number, text_edits: list>): void endif # if the buffer is not loaded, load it and make it a listed buffer - bnr->bufload() + :silent! bnr->bufload() setbufvar(bnr, '&buflisted', true) var start_line: number = 4294967295 # 2 ^ 32 diff --git a/autoload/lsp/util.vim b/autoload/lsp/util.vim index 023c835..c7b0d79 100644 --- a/autoload/lsp/util.vim +++ b/autoload/lsp/util.vim @@ -167,7 +167,7 @@ export def GetLineByteFromPos(bnr: number, pos: dict): number endif # Need a loaded buffer to read the line and compute the offset - bnr->bufload() + :silent! bnr->bufload() var ltext: string = bnr->getbufline(pos.line + 1)->get(0, '') if ltext->empty() @@ -194,7 +194,7 @@ export def GetCharIdxWithoutCompChar(bnr: number, pos: dict): number endif # Need a loaded buffer to read the line and compute the offset - bnr->bufload() + :silent! bnr->bufload() var ltext: string = bnr->getbufline(pos.line + 1)->get(0, '') if ltext->empty() -- 2.48.1