From 9dd43bc6b93a6a8dedbb562da4d33be104e54431 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 25 Feb 2024 00:32:12 -0600 Subject: [PATCH] fix(mappings): use explicit bufnr for meta return in `apply_text_edits` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since https://github.com/neovim/neovim/commit/2e1f5055acdef650c27efc4afdf8606037ec021b, Neovim now explicitly requires the bufnr for `vim.lsp.util.apply_text_edits` to be fully resolved — meaning it cannot be 0 or null. --- lua/orgmode/org/mappings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/orgmode/org/mappings.lua b/lua/orgmode/org/mappings.lua index 9c3256404..28d71bb62 100644 --- a/lua/orgmode/org/mappings.lua +++ b/lua/orgmode/org/mappings.lua @@ -645,7 +645,7 @@ function OrgMappings:meta_return(suffix) end if #text_edits > 0 then - vim.lsp.util.apply_text_edits(text_edits, 0, constants.default_offset_encoding) + vim.lsp.util.apply_text_edits(text_edits, vim.api.nvim_get_current_buf(), constants.default_offset_encoding) vim.fn.cursor(end_row + 1 + (add_empty_line and 1 or 0), 1) -- +1 for next line