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

Add repeatation support like 100j, 4 ^D, 20g, etc #45

Merged
merged 4 commits into from
Jun 29, 2021

Conversation

quark-zju
Copy link
Contributor

Add the missing feature existed in less / vim.

Copy link
Owner

@markbt markbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weirdly this is one of the less features that used to annoy me, as I'd often end up in weird modal states by accidentally hitting numbers. But the way it's implemented here seems much more usable. I think Esc clearing the pending numbers makes it much nicer.

This does reveal some places where I should've used saturating arithmetic, but didn't (e.g. src/screen.rs:858), as it's now feasible for users to scroll usize::MAX positions to the right. We probably need to fix those (but you don't have to do that right now).

src/bindings.rs Outdated Show resolved Hide resolved
src/screen.rs Outdated Show resolved Hide resolved
src/screen.rs Outdated Show resolved Hide resolved
src/screen.rs Outdated Show resolved Hide resolved
src/screen.rs Outdated Show resolved Hide resolved
@quark-zju quark-zju force-pushed the repeat branch 2 times, most recently from c2edafd to 5d03912 Compare June 28, 2021 14:04
Basic support something like 10j, 30k, etc.
Make things like 100G, or 100g behave like less or vim - go to line 100.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants