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

Count handling no longer accepts numbers containing zero #9871

Closed
trink opened this issue Mar 13, 2024 · 2 comments · Fixed by #9887
Closed

Count handling no longer accepts numbers containing zero #9871

trink opened this issue Mar 13, 2024 · 2 comments · Fixed by #9887
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@trink
Copy link
Contributor

trink commented Mar 13, 2024

Attempt to move 10 lines down 10j. When the zero is typed the count is cleared.

PR #8471 broke this functionality with the if expression in the match.

if !self.keymaps.contains_key(mode, event) =>

@trink
Copy link
Contributor Author

trink commented Mar 13, 2024

The reason for this is a key mapping. Will this no longer be allowed?

[keys.normal]
"0" = "goto_line_start"

@kirawi kirawi added C-bug Category: This is a bug A-helix-term Area: Helix term improvements labels Mar 13, 2024
@the-mikedavis
Copy link
Member

We should be able to support the bindings #8471 was trying to enable and also the one you posted. I believe we just need to split the count handling into two branches:

  • When the count has been started (cxt.editor.count.is_some()), any number always continues the count.
  • When the count hasn't been started (cxt.editor.count.is_none()), key!('1'..='9') starts the count if that key isn't bound to a command.

I'll post a patch

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