Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.4k stars 167 forks source link

Highlight Occurrences: can't scroll to hide line under caret #5440

Closed pintassilgo closed 3 months ago

pintassilgo commented 3 months ago

I just updated HiOccur after #5437 to test the improvement, but I noticed a new bug not present before the changes you made today.

I'm testing with the same SQL file I used on other tests: 22MB, 12K lines, with lines up to 12k chars (columns) each. For you to remember from previous screenshots I posted in other issues, it's the file full of NULL words.

The issue is: I scroll to bottom of the document, then place the caret over any word to highlight other matches, then turn scroll mousewheel up. As soon as the line where caret is placed is scrolled out of view, Cuda scrolls down back so that this line goes up and remains visible.

It's not needed to be at the bottom of the document to see the issue. You only need to be able to scroll up so that the line where the caret is placed hides from view, but the bug is that Cuda is blocking you from that, it's forcing the caret line to remain visible.

This issue is also not restricted to scroll up. If I try to scroll down it's the same, so Cuda is forcing caret line to remain visible no matter the scroll direction.

The only way to prevent the issue is by placing caret in a position that HiOccur doesn't highlight anything.

If I disable HiOccur or if I use the version without today commits, there's no issue.

pintassilgo commented 3 months ago

This is not related to word-wrap, because if even by disabling it the issue still exists.

But some other files I tested didn't triggered the issue, so I still doesn't know what's special in the file that is reproducing the bug.

This is not a session issue either, because I just pasted the entire file content to a new document, without even setting SQL lexer, and the issue is immediately reproducible.

Alexey-T commented 3 months ago

Easy to fix,

ed_self.set_caret(x, y, x2, y2, options=app.CARET_OPTION_NO_SCROLL)

was missed the last param options