Sublime Forum

Sublime Text 4 (4126) does not display matched count in Regexp mode

#1

Same issue as here https://sublimetext.userecho.com/en/communities/1/topics/3857-display-matched-count#

I just upgraded from 3 to 4. However it seems this feature has disappeared.
When I use search with regexp, normally it would give me “x of y matches” showing the matched count. However I see this feature missing now in sublime text 4 (4126).

0 Likes

#2

I use this feature everyday as an data engineer to search and modify data, is it possible to get this feature back for version 4?

0 Likes

#3

can’t reproduce in 4129.

neither in 4126

0 Likes

#4

ST4 / 4126 / Windows

I’ve loaded in a fairly large XML file ~3 million lines.

If I do a regex search for one of the commonly found patterns SEQUENCE_NO\=\" and Find All I end up with 53200 selection regions; Found 53200 matches in the status bar.

Find alone omits the “X of Y matches” and selection regions messages.

On a much smaller file, the “X of Y matches” version seems to pop up.

You can change this by adding the following lines to your settings Preferences -> Settings:

"find_highlight_matches_max_size": 0, // 16MiB

// Same as "find_highlight_matches_max_size" but used when regex is enabled.
"find_regex_highlight_matches_max_size": 0, // 1MiB

this then seemed to work as the OP expects.

I’m on a box with a fair amount of memory - 128Gb - but ST didn’t appear to rise above 1Gb with all my other ST windows / LSP etc. going.

1 Like

#5

Note that removing this limit has heavy performance implications as it means ST will search the entire file for every character you type.

2 Likes

#6

Thanks, that is exactly what I want!!!:grinning:

0 Likes

#7

i tested it again and this happens when the file is beyond ~210k lines (by default settings)

0 Likes

#8

Hey everyone, I’m trying the solution that mrsean2k posted by adding those lines to the preferences settings (listed again below), but I’m still not getting any search/highlight numbers posted. The doc I’m searching is only 7.7k lines long:
“find_highlight_matches_max_size”: 0, // 16MiB
“find_regex_highlight_matches_max_size”: 0, // 1MiB

Is there some other option that needs to be added?

0 Likes

#9

Is the “Highlight Matches” button enabled?

0 Likes

#10

It has happened for me in the past, and it’s been happening to me all week, currently. I can’t say when it suddenly ended-up back in my life with any certainty, but this week I’ve been searching a bunch of big files, I’ve really needed a count, and it’s been conspicuously absent.

There are 216K lines in the current file.

image

I’m using 4143

0 Likes

#11

Yes, my “highlight matches” option is selected, but deselecting it doesn’t seem to have a noticeable effect, even after disabling, closing the search, and then reopening it.

0 Likes

#12

Have you changed the "find_highlight_matches_max_size" and "find_regex_highlight_matches_max_size" settings as referenced above?

0 Likes

#13

No. I had missed that, but it worked (and I forgot to respond). Thanks for detailing that.

1 Like