From 500947f69f3d9e818cd7ed7260f2541bfb353644 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Thu, 8 Feb 2024 08:21:50 -0800 Subject: [PATCH] When applying a text edit, add the buffer (it might not be loaded) --- autoload/lsp/textedit.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.48.1