Skip to content

Commit a0f5ab4

Browse files
fix: fix TSNode selection (#416)
Fix the regression from a925c03 mentioned in #409
1 parent fcfa7e0 commit a0f5ab4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/nvim-surround/treesitter.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ M.get_selection = function(node_types)
9595
nodes[#nodes + 1] = cur
9696
-- Compute the node's selection and add it to the list
9797
local selection = M.get_node_selection(cur)
98-
selections_list[#selections_list + 1] = selection
98+
selections_list[#selections_list + 1] = {
99+
left = { first_pos = selection.first_pos },
100+
right = { last_pos = selection.last_pos },
101+
}
99102
end
100103
-- Pop off of the stack
101104
stack[#stack] = nil

0 commit comments

Comments
 (0)