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

Top/bottom commands accept a count and move to index #1040

Closed
wants to merge 1 commit into from

Conversation

ailac22
Copy link
Contributor

@ailac22 ailac22 commented Dec 8, 2022

Top/bottom commands now take a count if present, and move to a specific index or to a displacement if the count is relative (has a +/- symbol). Also, introduced the goToIndex function, which could be used in other moving functions in order to avoid repetition, such as up or down

…resent

top/bottom commands now take a count if present, and move to a specific
index or to a displacement if the count is relative (has a +/- symbol).
Also, introduced the `goToIndex` function, which could be used in other
moving functions in order to avoid repetition
@laktak
Copy link
Contributor

laktak commented Dec 8, 2022

Thank you for your PR! Could you explain the use case behind this? Unlike vim, lf does not display line numbers. How would you use this?

Also your mod function is very strange, can you explain?

@ailac22
Copy link
Contributor Author

ailac22 commented Dec 8, 2022

@laktak The use case is the same that it would have in vim. lf does display line numbers, with the :set number and :set relativenumber options. The mod function is just a modulo function that unlike Go's builtin modulus operator, it does accept negative numbers and return them to the positive interval. This is necessary because of the wrapscroll option and goToIndex being able to reimplement up() and down().

@laktak
Copy link
Contributor

laktak commented Dec 8, 2022

I didn't know we had that option - makes more sense now.

You should update the doc.go file and generate the others from that. Also take a look at the build errors.

@gokcehan
Copy link
Owner

gokcehan commented Apr 9, 2023

This patch is superseeded by #1196 which is now merged. @ailac22 Thanks for working on this and sorry for not being able to give feedback before.

@gokcehan gokcehan closed this Apr 9, 2023
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.

3 participants