]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Update the check for the presence of a diags location list and update comments
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 18 Jun 2023 13:49:12 +0000 (06:49 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 18 Jun 2023 13:49:12 +0000 (06:49 -0700)
autoload/lsp/diag.vim

index af738734b0e8c866610b131b0c8c7a3e0f2ed4af..7b6f8280fa49d24f3c728bc138c3a32e9bac96b9 100644 (file)
@@ -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