#97531 search ignores current line

Package:
less
Source:
less
Description:
pager program similar to more
Submitter:
Joey Hess
Date:
2026-06-02 07:15:02 UTC
Severity:
minor
#97531#5
Date:
2001-05-15 01:52:52 UTC
From:
To:
Searching with '/' ignores the current line. This is, of course, often
good -- it lets me search again and move forward in the file.

But, it tripped me up just now. I lessed a file, and the thing I was
looking for was in the first line of the file. But I didn't know that,
and I was assuming it was quite a way down, so I didn't bother to read a
thing, just ran a search, and it said "Pattern not found". And I took it at
its word (silly me). Only later, after exiting less and eventually running
grep did I notice it was in the first line of the file.

I think it would be nice if, after searching the rest of the file, less
went back and checked to see if the pattern was in the current line, and
said something like "Pattern only found in current line (you doofus)".

#97531#12
Date:
2026-06-02 07:12:24 UTC
From:
To:
Hello Joey,
I am not able to reproduce the behavior with the latest less-version in
Debian 13 (stable).

Can you confirm this to close the ticket?

Regards,
Christian