CudaText icon indicating copy to clipboard operation
CudaText copied to clipboard

Suggestion: Find dialog improvements

Open d0vgan opened this issue 2 years ago • 14 comments

I have a couple of suggestions for the Find dialog, hoping you'll find them useful. As a developer of QSearch plugin for AkelPad text editor, I really miss these tiny things:

  1. In the "Wrapped search" mode, there is no sign of passing the file boundary when the search continues from the very top/bottom of the files. For example, the QSearch plugin changes the background color of its "Find what" field to green to indicate this fact. Some other editors use the status bar to explicitly say that the search has been continued from the top/bottom of the file. Please consider adding this to CudaText.

  2. Incremental search (also known as search-as-you-type) is available only when "Highlight all matches" is available. For example, the QSearch plugin has a separate option named "Search: On-the-fly mode" which actually means the very same as Incremental search and search-as-you-type. This option works with ordinary text as well as with regular expressions, and there is another, separate option "Highlight all" which is responsible for highlighting the matches. So, two separate options. If you think that the search-as-you-type mode can have a negative impact on performance in large files, you may borrow the following idea from the QSearch plugin:

findall_count_delay = 400
     Delay, in milliseconds, before starting to count all the occurrences
     when both the "Auto Count All" and On-the-fly mode are on.

I mean, in case of Incremental search and huge file, the Incremental search can actually be started not immediately, but only after e.g. 400 ms passed after the last character has been typed. Example: user is typing "abc" where, say, 100 ms are passed between typing "a" and "b" and then, say, 150 ms are passed between typing "b" and "c". The Incremental search had not been started at this point. Now, only after 400 ms has passed after pressing "c", the Incremental search is started. Please consider adding a separate option for Incremental search into CudaText.

d0vgan avatar Feb 16 '23 21:02 d0vgan

Some other editors use the status bar to explicitly say that the search has been continued from the top/bottom of the file.

added. good small idea.

Screenshot from 2023-02-17 10-14-24

loot at statusbar - 'border crossed'

Alexey-T avatar Feb 17 '23 07:02 Alexey-T

about 2nd suggestion - 'separate Incremental / Highlight-all options'. let's the active Cud users tell what they think. i am sceptical, sorry. more work for me, very small profit.

@veksha @miroslavmatas @jairomartineza @vivalzar

Alexey-T avatar Feb 17 '23 07:02 Alexey-T

about 2nd suggestion - 'separate Incremental / Highlight-all options'. let's the active Cud users tell what they think. i am sceptical, sorry. more work for me, very small profit.

I am with you on that, Alexey… but - my situation is maybe different - happy user of Find in Lines, so my incremental search is always via external plugin…

MiroslavMatas avatar Feb 17 '23 09:02 MiroslavMatas

happy user of Find in Lines, so my incremental search is always via external plugin…

Did you mean "Find in Files"? I did not seem to find "Find in Lines"... I'm just starting my journey with CudaText and I'm already very impressed by how powerful, handy and thought-out it is!

d0vgan avatar Feb 17 '23 12:02 d0vgan

Find In Lines is a part of CudaExt plugin

Screenshot from 2023-02-17 15-17-32

Alexey-T avatar Feb 17 '23 12:02 Alexey-T

On one hand, there already are 2 ways of doing incremental search: highlight all and find in lines. On the other hand, it's true that highlight all does 2 things. We could split this button in 2 buttons. You are afraid that the find dlg will be too cluttered?

Vivalzar avatar Feb 17 '23 13:02 Vivalzar

You are afraid that the find dlg will be too cluttered?

and this too. Cud has 8 buttons in a row

Alexey-T avatar Feb 17 '23 13:02 Alexey-T

Cud has 8 buttons in a row

Maybe get rid of the multi-line button and make it automatic like in vs-code. If there are several lines in the find box, enlarge it. And reduce it when there are only one line.

You can then split the highlight all button in 2. All the code is already there presumably. It will just be organized differently.

Just a thought.

Vivalzar avatar Feb 17 '23 14:02 Vivalzar

i for sure don't want to remove 'multi line input' button. it gives the good hint to new users.

i will think about new button later, after 1.185.0.

Alexey-T avatar Feb 17 '23 18:02 Alexey-T

it gives the good hint to new users.

When the find field is empty, it contains the string Find what. Maybe we can replace it with Find what (Ctrl+Enter for a new line)?

Vivalzar avatar Feb 20 '23 08:02 Vivalzar

@Vivalzar but the "+" button has this info in the hint. i don't want to remove "+" and make the multi-line automatic. why? if I turn on the "+" mode, I want to see it permanently, not auto-toggled when I call the find.

Alexey-T avatar Feb 20 '23 09:02 Alexey-T

It was just an idea. Other editors don't have a multi-line mode, they have just a way to enter a new line.

Vivalzar avatar Feb 20 '23 09:02 Vivalzar

@veksha do you think that we can remove '+' button and make multi-line look automatic?

Alexey-T avatar Jul 04 '23 06:07 Alexey-T

Personally, i am not against that.

veksha avatar Jul 04 '23 06:07 veksha

seems we can close this topic, as 2 wishes from 1st post are implemented already, it seems:

  1. In the "Wrapped search" mode, there is no sign of passing the file boundary when the search continues from the very top/bottom of the files. For example, the QSearch plugin changes the background color of its "Find what" field to green to indicate this fact. Some other editors use the status bar to explicitly say that the search has been continued from the top/bottom of the file. Please consider adding this to CudaText.

option "find_wrapped_blinking" (default is empty: turned off).

  1. Incremental search (also known as search-as-you-type) is available only when "Highlight all matches" is available.

and this was implemented in last months too, AFAIR by the request from @pintassilgo. find-dialog has new 'Im' checkbox-option for 'immediate search'.

if topic contains other wishes, pls find them and report them to a new issue, pls.

Alexey-T avatar Jun 28 '24 14:06 Alexey-T