File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ function M.place_cursor_on_node()
148
148
if not node or node .name == " .." then
149
149
return
150
150
end
151
+ node = utils .get_parent_of_group (node )
151
152
152
153
local line = vim .api .nvim_get_current_line ()
153
154
local cursor = vim .api .nvim_win_get_cursor (0 )
Original file line number Diff line number Diff line change @@ -149,12 +149,11 @@ function M.get_node_from_path(path)
149
149
:iterate ()
150
150
end
151
151
152
- --- Get the highest parent of grouped nodes
153
- --- @param node_ Node
154
- --- @return table
155
- function M .get_parent_of_group (node_ )
156
- local node = node_
157
- while node .parent and node .parent .group_next do
152
+ --- Get the highest parent of grouped nodes
153
+ --- @param node Node
154
+ --- @return Node node or parent
155
+ function M .get_parent_of_group (node )
156
+ while node and node .parent and node .parent .group_next do
158
157
node = node .parent
159
158
end
160
159
return node
You can’t perform that action at this time.
0 commit comments