Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search result count display in the infobar #3637

Open
itlwas opened this issue Jan 26, 2025 · 2 comments
Open

Add search result count display in the infobar #3637

itlwas opened this issue Jan 26, 2025 · 2 comments

Comments

@itlwas
Copy link

itlwas commented Jan 26, 2025

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.

@Andriamanitra
Copy link
Contributor

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.

@dmaluka
Copy link
Collaborator

dmaluka commented Jan 26, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants