From f9773e4a5e0dbeda0d6f8a78d7d61eb802b6d0e1 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Fri, 31 May 2024 20:33:56 -0700 Subject: test: fix tests broken after 0.10 update (#6714) --- lua/nvim-treesitter/ts_utils.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'lua') diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua index 655c62881..9e9ada6aa 100644 --- a/lua/nvim-treesitter/ts_utils.lua +++ b/lua/nvim-treesitter/ts_utils.lua @@ -397,6 +397,7 @@ function M.swap_nodes(node_or_range1, node_or_range2, bufnr, cursor_to_second) local edit1 = { range = range1, newText = table.concat(text2, "\n") } local edit2 = { range = range2, newText = table.concat(text1, "\n") } + bufnr = bufnr == 0 and vim.api.nvim_get_current_buf() or bufnr vim.lsp.util.apply_text_edits({ edit1, edit2 }, bufnr, "utf-8") if cursor_to_second then -- cgit v1.2.3-70-g09d2