File tree 2 files changed +6
-6
lines changed 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ function M.place_cursor_on_node()
124
124
if not node or node .name == " .." then
125
125
return
126
126
end
127
+ node = utils .get_parent_of_group (node )
127
128
128
129
local line = vim .api .nvim_get_current_line ()
129
130
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