File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ function M.place_cursor_on_node()
143
143
if not node or node .name == " .." then
144
144
return
145
145
end
146
+ node = utils .get_parent_of_group (node )
146
147
147
148
local line = vim .api .nvim_get_current_line ()
148
149
local cursor = vim .api .nvim_win_get_cursor (0 )
Original file line number Diff line number Diff line change @@ -127,10 +127,11 @@ function M.get_node_from_path(path)
127
127
:iterate ()
128
128
end
129
129
130
- -- get the highest parent of grouped nodes
131
- function M .get_parent_of_group (node_ )
132
- local node = node_
133
- while node .parent and node .parent .group_next do
130
+ --- Get the highest parent of grouped nodes
131
+ --- @param node table
132
+ --- @return table node or parent
133
+ function M .get_parent_of_group (node )
134
+ while node and node .parent and node .parent .group_next do
134
135
node = node .parent
135
136
end
136
137
return node
You can’t perform that action at this time.
0 commit comments