]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Refer to buffer variable with "bufvar*" instead of "b:"
authorAndreas Louv <andreas@louv.dk>
Mon, 3 Apr 2023 21:18:05 +0000 (23:18 +0200)
committerAndreas Louv <andreas@louv.dk>
Mon, 3 Apr 2023 21:20:24 +0000 (23:20 +0200)
autoload/lsp/diag.vim

index 5da9e81e2dc69283ef5eca7b5e836ee706a5e1a3..cb304ce540f7c2c972ed61c5650fd9bc6ec4d118 100644 (file)
@@ -280,10 +280,9 @@ def DiagsUpdateLocList(lspserver: dict<any>, bnr: number): bool
     return false
   endif
 
-  var LspQfId: number = 0
-  if bnr->getbufvar('LspQfId', 0) != 0 &&
-               getloclist(0, {id: b:LspQfId}).id == b:LspQfId
-    LspQfId = b:LspQfId
+  var LspQfId: number = bnr->getbufvar('LspQfId', 0)
+  if !LspQfId->empty() && getloclist(0, {id: LspQfId}).id != LspQfId
+    LspQfId = 0
   endif
 
   if !lspserver.diagsMap->has_key(bnr) ||
@@ -315,7 +314,7 @@ def DiagsUpdateLocList(lspserver: dict<any>, bnr: number): bool
   endif
   setloclist(0, [], op, props)
   if LspQfId == 0
-    b:LspQfId = getloclist(0, {id: 0}).id
+    setbufvar(bnr, 'LspQfId', getloclist(0, {id: 0}).id)
   endif
 
   return true