From 67f86de449a8b693082f66e8f8fcb8a1d79dd45e Mon Sep 17 00:00:00 2001 From: Moshe Avni Date: Sun, 25 Feb 2024 16:04:38 +0200 Subject: [PATCH] fix applt_text_edits implicit bufnr --- lua/copilot/panel.lua | 2 +- lua/copilot/suggestion.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/copilot/panel.lua b/lua/copilot/panel.lua index 78c22b5f..5b9b9634 100644 --- a/lua/copilot/panel.lua +++ b/lua/copilot/panel.lua @@ -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("", true, false, true), "n", false) diff --git a/lua/copilot/suggestion.lua b/lua/copilot/suggestion.lua index d5be7a80..713a1c42 100644 --- a/lua/copilot/suggestion.lua +++ b/lua/copilot/suggestion.lua @@ -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("", 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 = "" if has_nvim_0_10_x then