From: Yegappan Lakshmanan Date: Sun, 18 Jun 2023 13:49:12 +0000 (-0700) Subject: Update the check for the presence of a diags location list and update comments X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=72448b8452674c871d3c85c61ecee2ffa9a1053d;p=vim-lsp.git Update the check for the presence of a diags location list and update comments --- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index af73873..7b6f828 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -422,13 +422,14 @@ def DiagsUpdateLocList(bnr: number, calledByCmd: bool = false): bool endif var LspQfId: number = bnr->getbufvar('LspQfId', 0) - if LspQfId->empty() && !opt.lspOptions.autoPopulateDiags && !calledByCmd - # If a location list for the diagnostics was not opened previously, - # and 'autoPopulateDiags' is set to false, then do nothing. + if LspQfId == 0 && !opt.lspOptions.autoPopulateDiags && !calledByCmd + # Diags location list is not present. Create the location list only if + # the 'autoPopulateDiags' option is set or the :LspDiagShow command is + # invoked. return false endif - if !LspQfId->empty() && getloclist(0, {id: LspQfId}).id != LspQfId + if LspQfId != 0 && getloclist(0, {id: LspQfId}).id != LspQfId # Previously used location list for the diagnostics is gone LspQfId = 0 endif