Cudatext: Highlight all matches, Ctlr+F and disable autoscrolling

Created on 13 May 2021  路  13Comments  路  Source: Alexey-T/CudaText

Hi @Alexey-T,

Let's imagine we have code like that:

func1(data):
    code...
    code...
    data
    code...

func2(data):
    code...
    data
    code...
    code...

The func1 and func2 functions are big and placed on different screens. Once, working with func2, I decide to check how often the data variable is used within func2. Then I perform:

  1. Double-click on the data word
  2. Press Ctr+F

I always have highlight all matches option enables, so I'm just expecting to see rectangles around the data word, nothing more. But CT scrolls the screen up to first match, i.e. in func1. If you compare it with ST, it will not scroll after pressing Ctrl+F. Is it possible in CT to have an option (not mandatory behaviour) not to scroll for the first match after pressing Ctrl+F (same as in CT) if the option highlight all matches is enabled?

enhancement

Most helpful comment

about this?

1-- if I type "z" ST does NOT scroll to up

Shouldn't this be on the 'wrapped search' option? - If 'on' - scroll to "z", 'off' - don't scroll. Basically just scroll to the first occurrence, but from the cursor position

And the idea in general - I think is a good one

All 13 comments

But ST moves caret/scroll to the 1st found match in Hi-all mode. you tell it does not. maybe it does not, only if current view-area has some of found matches? so logic is: if current view-area has one of mathes, do not scroll?

try this file

bb
zz









aa
bb










aa
bb








aa
bb
















aa
bb













aa
bb
kk

and this ST window size

Screenshot from 2021-05-21 00-28-36

1-- if I type "z" ST does NOT scroll to up
2-- if I type "k" ST does scroll down

maybe logic is: scroll ONLY down, not up?

1-- if I type "z" ST does NOT scroll to up
2-- if I type "k" ST does scroll down

I have 3.2.2 build 3211 and with the same text it scrolls the visible area in both direction as for "z" as for "k" as well

if current view-area has one of mathes, do not scroll?

Seems, yes. I'm OK with that logic, so if it has something to highlight in the visible area in doesn't scroll, otherwise it scrolls the area.
It doesn't scroll for "a" and "b" but scrolls for "z" and "k" in my case. It would be great to have an option to enable the same feature in CT :)

@halfbrained @jairomartineza Do you confirm my idea about Sublime logic? Or do you confirm @xcme idea?

about this?

1-- if I type "z" ST does NOT scroll to up

Shouldn't this be on the 'wrapped search' option? - If 'on' - scroll to "z", 'off' - don't scroll. Basically just scroll to the first occurrence, but from the cursor position

And the idea in general - I think is a good one

'wrapped search' option

Yes!
@Alexey-T, I tested with/w/o this options and it depends. If I disable it I see the same behavior as you described. I mean it doesn't scroll up to "z".

OK, made work on it. will be in next beta.

beta updated! folder /c.

Works well.

Is there a way to change to highlight color? Green is almost invisible on my theme.

This green is taken from the syntax theme- so yes

Found - "SeparLine", thanks. I was looking for something "search"-related in color names :)

@xcme I hope now it is OK.

problem found with this patch, #3422.
reverting some part of this...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alexey-T picture Alexey-T  路  4Comments

xcme picture xcme  路  5Comments

Alexey-T picture Alexey-T  路  4Comments

Alexey-T picture Alexey-T  路  5Comments

jczanfona picture jczanfona  路  5Comments