Skip to content

Commit

Permalink
When applying a text edit, add the buffer (it might not be loaded)
Browse files Browse the repository at this point in the history
  • Loading branch information
yegappan committed Feb 8, 2024
1 parent 5cab3be commit 500947f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autoload/lsp/textedit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 500947f

Please sign in to comment.