Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix applt_text_edits implicit bufnr
  • Loading branch information
Moshe Avni committed Feb 25, 2024
commit 67f86de449a8b693082f66e8f8fcb8a1d79dd45e
2 changes: 1 addition & 1 deletion lua/copilot/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function panel:accept()

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

Expand Down
2 changes: 1 addition & 1 deletion lua/copilot/suggestion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ function mod.accept(modifier)

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