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

fix for issue #2675: search feature should not search on line numbers and headers #2689

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tdtrung17693
Copy link

@tdtrung17693 tdtrung17693 commented Oct 1, 2023

It fixes #2675

Currently, less will perform the search on all the content that is written on its STDIN. To make it ignore the headers and the line numbers, less, from version 600, has added 2 new options:

  • --header to set the headers (filename, file size, and panel text)
  • --no-search-headers to ignore those headers.

So, I will use those 2 options to make the search work correctly.

Btw, as I said above, this fix is only applicable for less version from 600 and above because those options only existed from that version.

@tdtrung17693 tdtrung17693 changed the title fix for issue #2675 fix for issue #2675: search feature should not search on line numbers and headers Oct 4, 2023
@sharkdp
Copy link
Owner

sharkdp commented Feb 23, 2024

Thank you very much — this looks great! Didn't know less had those new features. Do you think it would be possible to write (integration) tests for? I think we mock pager calls in some other tests as well. We could do something similar and check that the mocked less pager is called with the correct offsets.

@tdtrung17693
Copy link
Author

Ok. Let me try that.

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.

Search feature searches on line numbers
2 participants