]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
When applying a text edit, add the buffer (it might not be loaded)
authorYegappan Lakshmanan <yegappan@yahoo.com>
Thu, 8 Feb 2024 16:21:50 +0000 (08:21 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Thu, 8 Feb 2024 16:21:50 +0000 (08:21 -0800)
autoload/lsp/textedit.vim

index 9a2b8c5f2c7bcefbf359ca8d5dea9a795e509d19..ee4cc4a62ab27c30ba4c1aaff24e7a936275770e 100644 (file)
@@ -211,7 +211,7 @@ enddef
 
 # interface TextDocumentEdit
 def ApplyTextDocumentEdit(textDocEdit: dict<any>)
-  var bnr: number = bufnr(util.LspUriToFile(textDocEdit.textDocument.uri))
+  var bnr: number = util.LspUriToBufnr(textDocEdit.textDocument.uri)
   if bnr == -1
     util.ErrMsg($'Text Document edit, buffer {textDocEdit.textDocument.uri} is not found')
     return
@@ -269,6 +269,7 @@ enddef
 def FileRename(renameFile: dict<any>)
   var old_fname: string = util.LspUriToFile(renameFile.oldUri)
   var new_fname: string = util.LspUriToFile(renameFile.newUri)
+
   var opts: dict<bool> = renameFile->get('options', {})
   var overwrite: bool = opts->get('overwrite', false)
   var ignoreIfExists: bool = opts->get('ignoreIfExists', true)