Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions lua/nvim-surround/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,7 @@ end
---@nodiscard
M.get_root = function()
local node = get_node()
if node == nil then
return nil
end

while node:parent() ~= nil do
node = node:parent()
end

return node
return node and node:tree():root()
end

-- Gets the current smallest node at the cursor.
Expand Down
Loading