Skip to content

Commit

Permalink
fix(motion): ignores @ and other reader macros as form's edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Samy-33 committed Oct 2, 2023
1 parent 0bab279 commit eb9556d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion lua/nvim-paredit/api/motions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ local function move_to_parent_form_edge(direction)
local form_node_to_move_to = nearest_form_node
while is_cursor_at_form_edge(form_node_to_move_to, direction, cur_cursor_pos, lang)
do
form_node_to_move_to = form_node_to_move_to:parent()
form_node_to_move_to = lang.get_node_root(form_node_to_move_to):parent()
if not form_node_to_move_to or form_node_to_move_to:type() == "source" then
return
end
Expand Down
6 changes: 0 additions & 6 deletions tests/nvim-paredit/motion_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,6 @@ describe("motions", function()
cursor = { 1, 10 },
})

-- (aa (bb) |@(cc) #{1})
internal_api.move_to_parent_form_start()
expect({
cursor = { 1, 9 },
})

-- |(aa (bb) @(cc) #{1})
internal_api.move_to_parent_form_start()
expect({
Expand Down

0 comments on commit eb9556d

Please sign in to comment.