Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat last motion doesn't apply to "next function" #1993

Closed
heliostatic opened this issue Apr 6, 2022 · 2 comments · Fixed by #3264
Closed

Repeat last motion doesn't apply to "next function" #1993

heliostatic opened this issue Apr 6, 2022 · 2 comments · Fixed by #3264
Assignees
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@heliostatic
Copy link
Contributor

Related to #1954, A-. doesn't repeat Goto next function (and possibly others).

It seems like perhaps the A-. keymap doesn't actually work for #1954 although the command palette does work as expected.

@kirawi kirawi added C-bug Category: This is a bug A-helix-term Area: Helix term improvements labels Apr 6, 2022
@heliostatic
Copy link
Contributor Author

Repeat last command also doesn't appear to apply to view commands in the z menu:

        },
        "z" => { "View"
            "z" | "c" => align_view_center,
            "t" => align_view_top,
            "b" => align_view_bottom,
            "m" => align_view_middle,
            "k" | "up" => scroll_up,
            "j" | "down" => scroll_down,
            "C-b" | "pageup" => page_up,
            "C-f" | "pagedown" => page_down,
            "C-u" => half_page_up,
            "C-d" => half_page_down,
        },

@heliostatic
Copy link
Contributor Author

Seems like the issue is basically that for select_textobject (https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs#L4013), the last_motion gets set:
cx.editor.last_motion = Some(Motion(Box::new(textobject)));
(https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs#L4060)

But for goto_ts_object_impl (https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs#L3951) it does not, hence, not repeatable.

Looking through this file, it's probably worth a larger refactoring of move and select commands to make sure they're always repeatable, undoable, etc.

@the-mikedavis the-mikedavis changed the title Repeat last command doesn't apply to "next function" Repeat last motion doesn't apply to "next function" May 9, 2022
@the-mikedavis the-mikedavis self-assigned this Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants