Cudatext: Can we have counter for matches as other popular editor has?

Created on 17 Mar 2021  Â·  20Comments  Â·  Source: Alexey-T/CudaText

Something like this in statusbar:
image

incorrect

All 20 comments

please excuse me…
is this what you are looking for?
Screenshot 2021-03-17 210132

@MiroslavMatas let me check it. How can I achieve it?

plugin Highlight Occurrences
_must have_ for me

Thanks. But could we get it as a built-in feature?

Highlight Occur as build in code? not in near months.

reason is big set of options.
Screenshot from 2021-03-17 23-28-44

Highlight Occur as build in code? not in near months.

No, just the info as I posted on my screenshot, not the whole functionality.

to get that 'info' my code needs to do 'find all' with many options- whole words, min len...

to get that 'info' my code needs to do 'find all' with many options- whole words, min len...

But it already can show total number of matches, right? Could CT just do it again for _find next_ / _find previous_ functions, but for text _between caret and end or beginning of the text?_ So, we press F3, it jumps for some position and calculate this value again and then compare it.

it already can show total number of matches, right?

no, Cud on action 'find next' don't have that info.

Let me explain, do not close for today, please :) I will prepare explanation in 10 minutes

Ok

So, when I'm looking something with 'Hi' options it shows me in the status bar:
Found 4 different fragments
So, it already knows the total number. Then I press Ctrl+F and it puts the caret directly before the first match. So, it knows it's 1/4 now.
Then I press F3 (find next) and Ctrl+F again. Now it puts the caret directly after the next match. (Btw, is it expected to place the caret before first time and after in other cases?) So, I'm asking if CT can perform this search operation again, but not for whole text but _for text between current caret position and the end of the text_? If yes, it's obvious there are only 2 matches, so, the current position 4-2 = 2/4 and so on.

Cud does 'find-all' for option 'Hi'; but it don't do 'find-all' for 'find-next'! so after find-next Cud don't know about more matches

That's exactly what I'm talking about. Why it couldn't perform find-next followed by find-all in background? It's expected CT doesn't do it now, but it seems it can in theory :)

why it don't do it

  • it avoids find-all code this is slow (on 200K file)
  • it has DIFFERENT opts than Highlite Occur plugin, so Cud may find-all 20 items and HiliteOccur can find 23 items.

I don't care about this plugin, I believe there is a simple way to do it with few small changes :) Btw, when I performed some testing I got this:
image
Note, bbb is in the search prompt. I just inserted some empty lines and then Ctrl+Z it and got a mess.

And topic-related question. Does CT keep positions of highlighted block in memory?

when I performed some testing I got this:

please put this in a new report.

Does CT keep positions o

of course.

I don't care about this plugin, I believe there is a simple way to do it with few small changes

no, it 's not that simple.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alexey-T picture Alexey-T  Â·  7Comments

Alexey-T picture Alexey-T  Â·  5Comments

charliewales picture charliewales  Â·  4Comments

jczanfona picture jczanfona  Â·  5Comments

Alexey-T picture Alexey-T  Â·  5Comments