Alexey-T / CudaText

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

Cuda suddenly performs "Find" 2 seconds after I pause while typing in document #5476

Closed pintassilgo closed 2 months ago

pintassilgo commented 2 months ago

(Edit: you can skip to next comment, it's easy to reproduce and you will understand the issue, so reading the explanation in the rest of this first comment isn't needed.)

It's happening to me, I'll update if I can find consistent steps to reproduce from a new document.

I am editing a document, writing text. Previously, I had used find in this document, so find bar is visible and I can see a highlighted match a few lines above caret position in where I'm currently typing.

The issue is: I'm typing text, but if I stop for something like 2s or 2.5s, suddenly Cuda performs the find again, selecting the match, also printing the default message in status ("Found next match [1/1] (wrapped, edge-corss, from-caret"). So I lose caret position where I was typing, and if I type a char it replaces the match, because the match is selected.

If I just move caret and wait, for instance clicking at the end of a line, this issue doesn't happen. I need to type a char and wait for this strange "timer" to start. Deleting a char also enables the timer, so it starts after changing document value.

pintassilgo commented 2 months ago

STR:

  1. Open a new document. Make sure both Hi and Im are enabled.

  2. Paste this content:

    tst abc

  3. Press Ctrl+F and type tst in find input. The match will be selected in first line.

  4. Click at the end of second line to place caret there, then type a char, like a.

  5. Now just wait 3 seconds. Suddenly Cuda will select tst as if you pressed F3, but you didn't.

Alexey-T commented 2 months ago

Confirmed. Fixed.

pintassilgo commented 2 months ago

Thanks. Could you please upload the beta? It's more reliable to run tests for #5473 using latest code, as both issues are related to Find.

Alexey-T commented 2 months ago

Of course: beta updated (same www folder).

pintassilgo commented 2 months ago

Thanks. This issue isn't properly fixed. Now the selection is removed after 2s even if I do nothing after typing in Find.

Alexey-T commented 2 months ago

What steps, please?

pintassilgo commented 2 months ago

STR:

  1. Open a new document. Make sure both Hi and Im are enabled.

  2. Paste this content:

    tst abc

  3. Press Ctrl+F and type tst in find input. The match will be selected in first line.

  4. Just wait 3 seconds. The selection in the found match is removed.

pintassilgo commented 2 months ago

Right after typing tst in find input: image

A few moments later, the selection is removed, with the word turned into a non-current match (because only current match is selected) even if I did nothing: image

Alexey-T commented 2 months ago

I see it now (harder on Gtk2)

Alexey-T commented 2 months ago

Beta updated, fixed again

pintassilgo commented 2 months ago

Thanks, looks good now. Let's go to the other issue.