]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Rename buf.vim to diag.vim
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 9 Jan 2022 19:29:51 +0000 (11:29 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 9 Jan 2022 19:29:51 +0000 (11:29 -0800)
autoload/diag.vim [moved from autoload/buf.vim with 100% similarity]
autoload/handlers.vim
autoload/lsp.vim

similarity index 100%
rename from autoload/buf.vim
rename to autoload/diag.vim
index 402ba3e15b46733cfb4efb0b0cc1411a93bf9ad9..02479f6d7938e4e15d1c4579da1383e96bf2a6ce 100644 (file)
@@ -6,12 +6,12 @@ vim9script
 
 var opt = {}
 var util = {}
-var buf = {}
+var diag = {}
 
 if has('patch-8.2.4019')
   import './lspoptions.vim' as opt_import
   import './util.vim' as util_import
-  import './buf.vim' as buf_import
+  import './diag.vim' as diag_import
 
   opt.lspOptions = opt_import.lspOptions
   util.WarnMsg = util_import.WarnMsg
@@ -19,7 +19,7 @@ if has('patch-8.2.4019')
   util.TraceLog = util_import.TraceLog
   util.LspUriToFile = util_import.LspUriToFile
   util.GetLineByteFromPos = util_import.GetLineByteFromPos
-  buf.LspDiagsUpdated = buf_import.LspDiagsUpdated
+  diag.LspDiagsUpdated = diag_import.LspDiagsUpdated
 else
   import lspOptions from './lspoptions.vim'
   import {WarnMsg,
@@ -27,7 +27,7 @@ else
        TraceLog,
        LspUriToFile,
        GetLineByteFromPos} from './util.vim'
-  import {LspDiagsUpdated} from './buf.vim'
+  import {LspDiagsUpdated} from './diag.vim'
 
   opt.lspOptions = lspOptions
   util.WarnMsg = WarnMsg
@@ -35,7 +35,7 @@ else
   util.TraceLog = TraceLog
   util.LspUriToFile = LspUriToFile
   util.GetLineByteFromPos = GetLineByteFromPos
-  buf.LspDiagsUpdated = LspDiagsUpdated
+  diag.LspDiagsUpdated = LspDiagsUpdated
 endif
 
 # process the 'initialize' method reply from the LSP server
@@ -110,7 +110,7 @@ def s:processDefDeclReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>
     var bnr: number = fname->bufnr()
     if bnr != -1
       if &modified || &buftype != ''
-       exe 'sb ' .. bnr
+       exe 'sbuffer ' .. bnr
       else
        exe 'buf ' .. bnr
       endif
@@ -1045,7 +1045,7 @@ def s:processDiagNotif(lspserver: dict<any>, reply: dict<any>): void
   endfor
 
   lspserver.diagsMap->extend({['' .. bnr]: diag_by_lnum})
-  buf.LspDiagsUpdated(lspserver, bnr)
+  diag.LspDiagsUpdated(lspserver, bnr)
 enddef
 
 # process a show notification message from the LSP server
index 4c66326ce10f4968a78f208286a729ad55f4a1e6..33487c4d2eae00a0403ede46ef88a5e1e5bec639 100644 (file)
@@ -5,13 +5,13 @@ vim9script
 var opt = {}
 var lserver = {}
 var util = {}
-var buf = {}
+var diag = {}
 
 if has('patch-8.2.4019')
   import './lspoptions.vim' as opt_import
   import './lspserver.vim' as server_import
   import './util.vim' as util_import
-  import './buf.vim' as buf_import
+  import './diag.vim' as diag_import
 
   opt.LspOptionsSet = opt_import.LspOptionsSet
   opt.lspOptions = opt_import.lspOptions
@@ -22,7 +22,7 @@ if has('patch-8.2.4019')
   util.ClearTraceLogs = util_import.ClearTraceLogs
   util.GetLineByteFromPos = util_import.GetLineByteFromPos
   util.PushCursorToTagStack = util_import.PushCursorToTagStack
-  buf.LspDiagsUpdated = buf_import.LspDiagsUpdated
+  diag.LspDiagsUpdated = diag_import.LspDiagsUpdated
 else
   import {lspOptions, LspOptionsSet} from './lspoptions.vim'
   import NewLspServer from './lspserver.vim'
@@ -32,7 +32,7 @@ else
         ClearTraceLogs,
         GetLineByteFromPos,
         PushCursorToTagStack} from './util.vim'
-  import {LspDiagsUpdated} from './buf.vim'
+  import {LspDiagsUpdated} from './diag.vim'
 
   opt.LspOptionsSet = LspOptionsSet
   opt.lspOptions = lspOptions
@@ -43,7 +43,7 @@ else
   util.ClearTraceLogs = ClearTraceLogs
   util.GetLineByteFromPos = GetLineByteFromPos
   util.PushCursorToTagStack = PushCursorToTagStack
-  buf.LspDiagsUpdated = LspDiagsUpdated
+  diag.LspDiagsUpdated = LspDiagsUpdated
 endif
 
 # Needs Vim 8.2.2342 and higher
@@ -303,7 +303,7 @@ def lsp#leftInsertMode()
   if lspserver->empty() || !lspserver.running
     return
   endif
-  buf.LspDiagsUpdated(lspserver, bufnr())
+  diag.LspDiagsUpdated(lspserver, bufnr())
 enddef
 
 # A new buffer is opened. If LSP is supported for this buffer, then add it