From: Yegappan Lakshmanan Date: Thu, 8 Feb 2024 16:21:50 +0000 (-0800) Subject: When applying a text edit, add the buffer (it might not be loaded) X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=500947f69f3d9e818cd7ed7260f2541bfb353644;p=vim-lsp.git When applying a text edit, add the buffer (it might not be loaded) --- diff --git a/autoload/lsp/textedit.vim b/autoload/lsp/textedit.vim index 9a2b8c5..ee4cc4a 100644 --- a/autoload/lsp/textedit.vim +++ b/autoload/lsp/textedit.vim @@ -211,7 +211,7 @@ enddef # interface TextDocumentEdit def ApplyTextDocumentEdit(textDocEdit: dict) - 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) var old_fname: string = util.LspUriToFile(renameFile.oldUri) var new_fname: string = util.LspUriToFile(renameFile.newUri) + var opts: dict = renameFile->get('options', {}) var overwrite: bool = opts->get('overwrite', false) var ignoreIfExists: bool = opts->get('ignoreIfExists', true)