Summary: | less search doesn't work correct, when searching big files with very long lines 26k chars | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Hans-Christian Armingeon <mog.johnny> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | packs file |
Description
Hans-Christian Armingeon
2004-11-06 11:19:41 UTC
Created attachment 43423 [details]
packs file
are you sure it's just not because less hasnt finished loading the file into memory ? less only searches what has been loaded thus far into the memory buffer ... try running less on the file, then wait until you're sure the whole thing is loaded (hold 'end' until the end of the file shows up), then hit 'home' and try searching I scrolled down the whole document. Scrolles up, searched for windowmaker. Result: Pattern not found. Scrolled down, windowmaker has been inverted. As I said, there is no newline in this document, only at the very end. Johnny This is known as "enhancement request 253" on the upstream <http://www.greenwoodsoftware.com/less/bugs.html> web page. The search works; it's only that it displays the first screen-row of the folded file-line which contain the match(es). To convince yourself of this, insert 100 short file-lines containing just "asdf" before the single long file-line in file "packs", insert the same after this long file-line, and repeat your search, either forward or backward. It will find the matching file-line. We may want to fix this by having less move in turn (each time 'n' is pressed) to each match that _begins_ on a new screen-row. I have worked on some of the less source code and may take a look at this, but no promises. Fixing this may be more involved than it appears, depending on how things are done internally. ah, thanks for the info :) |