micro icon indicating copy to clipboard operation
micro copied to clipboard

Add search result count display in the infobar

Open itlwas opened this issue 11 months ago • 2 comments

Hi! I really enjoy using Micro as my terminal text editor, and I have a feature suggestion to improve the search experience. Currently, when searching for text using Ctrl+F, Micro highlights the matches but doesn't show the total number of results found.

It would be very useful if Micro could display the total number of matches in the infobar. For example, something like:
Found 6 results or Match 1 of 6.

This would make it easier to understand how many occurrences of the search term exist in the document and navigate through them.

itlwas avatar Jan 26 '25 09:01 itlwas

I suspect the reason it doesn't is that it can return early if it finds a match (instead of going through the entire file), but I agree that this would be a good feature to have. I often find myself cycling through the matches and forgetting where I started so I go through them all multiple times. If there was an indicator like "Match 3 of 6" it would be easier to make note of where the cycle started.

Andriamanitra avatar Jan 26 '25 15:01 Andriamanitra

I suspect the reason it doesn't is that it can return early if it finds a match (instead of going through the entire file)

Yes, that is the reason. Furthermore, even with hlsearch enabled, i.e. when micro highlights all found matches, in fact it searches and highlights only those matches that it needs to highlight, i.e. only the matches in the currently displayed part of the file, not all the matches in the entire file.

dmaluka avatar Jan 26 '25 17:01 dmaluka