Skip to content

Commit f7612f5

Browse files
author
Moshe Avni
authored
fix applt_text_edits implicit bufnr (zbirenbaum#274)
1 parent 03f8259 commit f7612f5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lua/copilot/panel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function panel:accept()
237237

238238
vim.lsp.util.apply_text_edits({
239239
{ range = entry.range, newText = entry.completionText },
240-
}, 0, "utf-16")
240+
}, vim.api.nvim_get_current_buf(), "utf-16")
241241
-- Put cursor at the end of current line.
242242
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<End>", true, false, true), "n", false)
243243

lua/copilot/suggestion.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ function mod.accept(modifier)
484484

485485
-- Hack for 'autoindent', makes the indent persist. Check `:help 'autoindent'`.
486486
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Space><Left><Del>", true, false, true), "n", false)
487-
vim.lsp.util.apply_text_edits({ { range = range, newText = newText } }, 0, "utf-16")
487+
vim.lsp.util.apply_text_edits({ { range = range, newText = newText } }, vim.api.nvim_get_current_buf(), "utf-16")
488488
-- Put cursor at the end of current line.
489489
local cursor_keys = "<End>"
490490
if has_nvim_0_10_x then

0 commit comments

Comments
 (0)