Sublime Forum

Improve information in status bar when Find function is started

  1. Select a word in some text file
  2. Press CTRL+F to start the find function.

The find toolbar is displayed with the selected word.
In the status bar, the number of matches for that word is shown (e.g. 4 matches)
I propose to improve that status bar information by adding the position of the current selection in the list of matches (e.g. 2 of 4 matches).
This extended information is already available in ST but it is only shown when I press the Find button to find next match. However, very often I only need to know the position of the word in the list without having to jump to the next match.




The “2 of” is shown when your current selection is in the find results. Selecting a word and pressing ctrl+f shows “2 of 4 matches” for me.



Ideed, now I don’t see the problem either. I’ll see under which circumstances the problem repeats and report here. Thanks.



It happened again. I cannot say, under which circumstances, but in some cases the issue described above just happens. After I press “Find next” the issue is gone and cannot be reproduced.



I guess it should be easy to find the issue by just analysing the source code. Reproducing the issue is not so easy.



I already went over the relevant source code and couldn’t come up with a way it would fail unless you just don’t have the search result selected.



I think this is expected behaviour (or at least, I would expect it).

The text n of n shows you how many instances of the search text there are and which one is currently selected. If you open the Find panel and enter a search string, the search happens and you can see that the first matching item is selected, with the remainder of them highlighted:

On the other hand, if you open up the Find panel after doing the search, the most recent search term is reused and you can see all of the matches highlighted, but none of them are actually selected, so the status bar only tells you how many matches there are:

In such a case you need to press Enter or click the Find button to execute the search and select the first match, which then populates what you’d expect into the status bar.

Note that this requires Highlight Matches to be turned on; otherwise opening the find panel and entering a search string has no visual effect until you press Enter or click Find in both cases.



Yes, this is known and logical, since there is nothing selected.
I mean, that I happens also sometime even if there is something selected.