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

matches on the right of the screen are ignored #21

Closed
sgerwk opened this issue Apr 13, 2018 · 7 comments
Closed

matches on the right of the screen are ignored #21

sgerwk opened this issue Apr 13, 2018 · 7 comments

Comments

@sgerwk
Copy link
Contributor

sgerwk commented Apr 13, 2018

When the document contains pre or table elements, some parts of the document may fall "outside of the screen", on its right. When searching for a pattern that has a match in them, elinks correctly scrolls the screen to make them visible. It however does not if some other matches are already "in the screen".

An example is in this html page
notfound.html.gz
when viewed in 80 columns.

Searching for the pattern "some" highlights the first and third matches. However, the second is not in the screen, and elinks never scrolls to show it when pressing 'n'. It does when searching for "something".

rkd77 added a commit that referenced this issue Apr 14, 2018
Before only visible part of screen was searched for pattern.
Now whole document is searched, and beginings of found text
is remembered in document->search_points.
@rkd77
Copy link
Owner

rkd77 commented Apr 15, 2018

sgwerk, this commit helped or not? Now it behaves more like less. Every n jumps to next search and N to previous.

@sgerwk
Copy link
Contributor Author

sgerwk commented Apr 15, 2018

Thanks, but unfortunately there are still some problems. On the enclosed file notfound.html elinks goes to the second match, but then doesn't go back to the first when wrapping around. On the second outofmemory.html it crashes (file log).

other.tar.gz

All of this with the version before the last commit. After the very last commit, elinks also crashes on the first file.

@sgerwk
Copy link
Contributor Author

sgerwk commented Apr 15, 2018

Forgot to say: in both files, the search pattern was "yyy"

When checked them again, I realized that the crash on the first file notfound.html was due to a different running condition, not to the last commit.

@rkd77
Copy link
Owner

rkd77 commented Apr 15, 2018

@sgerwk For wraparound I must look how it was before.
How much RAM do you have? Or what are the limits? What are your configure options?
Is this crash reproducible?

@sgerwk
Copy link
Contributor Author

sgerwk commented Apr 15, 2018

The crash happens every time. I start elinks with ./src/elinks ~/temp/outofmemory.html and then went to search for "yyy", and elinks crashes.

MemTotal: 770264 kB
max memory size (kbytes, -m) unlimited
./configure --prefix=/usr --sysconfdir=/etc --enable-cgi --without-zlib --enable-bittorrent

It's very limited memory, but I got the crash with a mostly unloaded system - no X, no special server active. With elinks running but before starting the search, the situation was:

MemTotal: 770264 kB
MemFree: 364256 kB
MemAvailable: 652224 kB

elinks itself used very little memory. Monitoring with top(1), it didn't seem to increase much. Rather, it looked like it tried to malloc() too much at once, and failed.

rkd77 added a commit that referenced this issue Apr 15, 2018
@rkd77
Copy link
Owner

rkd77 commented Apr 15, 2018

@sgerwk I fixed one bug. Try now.

@sgerwk
Copy link
Contributor Author

sgerwk commented Apr 15, 2018

Thanks, wraparound now works!

Regarding memory exhaustion, here is the memory elinks uses on noback.html before searching for "yyy"

MemTotal: 770264 kB
MemAvailable: 647272 kB

and here's after:

MemTotal: 770264 kB
MemAvailable: 49432 kB

Seems like very little is used for viewering the document itself, but a huge amount is allocated after searching. The memory used does not decrease after searching for a non-existing pattern.

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

No branches or pull requests

2 participants