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

Feature Request: Make search move to the correct position on long lines, instead of just focusing the correct line #58

Closed
sosmo opened this issue Apr 25, 2020 · 1 comment

Comments

@sosmo
Copy link

sosmo commented Apr 25, 2020

Currently search (/, ?, n and N) only moves to the line of the next match, but if a line is long and doesn't fit the terminal window, less won't scroll to show the position of the match. The Busybox version of less, however, does bring the match into the view even if it's at the end of a very long line.

Here's an example creating a long line of A's that fills the terminal window, then trying to find the B at the end:

(printf 'A%.0s' {1..10000} ; echo B) | less

Searching for "B" (/b) doesn't scroll the line and thus you won't see the matched "B". Pressing G moves to the end and you see it highlighted, but finding the "B" otherwise is very difficult.

This feature would make less work similarly to Busybox's version and would make less more useful for dealing with large data files.

@gwsw
Copy link
Owner

gwsw commented Jan 20, 2021

Fixed in 4a35631.

@gwsw gwsw closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants