Skip to content

Commit

Permalink
Merge pull request #55 from NoahTheDuke/nb/explicit-bufnum
Browse files Browse the repository at this point in the history
Explicit bufnum when calling ts.swap_nodes
  • Loading branch information
julienvincent committed Feb 28, 2024
2 parents 9a895d1 + 14dfba6 commit a3e195a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lua/nvim-paredit/api/dragging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function M.drag_form_forwards()
return
end

ts.swap_nodes(root, sibling, 0, true)
local buf = vim.api.nvim_get_current_buf()
ts.swap_nodes(root, sibling, buf, true)
end

function M.drag_form_backwards()
Expand All @@ -39,7 +40,8 @@ function M.drag_form_backwards()
return
end

ts.swap_nodes(root, sibling, 0, true)
local buf = vim.api.nvim_get_current_buf()
ts.swap_nodes(root, sibling, buf, true)
end

function M.drag_element_forwards()
Expand All @@ -51,7 +53,8 @@ function M.drag_element_forwards()
return
end

ts.swap_nodes(current_node, sibling, 0, true)
local buf = vim.api.nvim_get_current_buf()
ts.swap_nodes(current_node, sibling, buf, true)
end

function M.drag_element_backwards()
Expand All @@ -63,7 +66,8 @@ function M.drag_element_backwards()
return
end

ts.swap_nodes(current_node, sibling, 0, true)
local buf = vim.api.nvim_get_current_buf()
ts.swap_nodes(current_node, sibling, buf, true)
end

return M

0 comments on commit a3e195a

Please sign in to comment.