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

Search results indicators on scrollbar #19

Open
michael-nhat opened this issue May 22, 2024 · 3 comments
Open

Search results indicators on scrollbar #19

michael-nhat opened this issue May 22, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@michael-nhat
Copy link

Is it possible to indicate search results on scroll bar? For example, in chromium browser, you can press C-f to see search results as yellow stripes on scrollbar. Could we have a function like make-match-indicator(line) to implement it?

@jdtsmith
Copy link
Owner

Interesting idea, but I think it would be very complicated to implement given the current draw model. Perhaps a partner mode of some kind, that draws just below the scrollbar?

@michael-nhat
Copy link
Author

michael-nhat commented May 28, 2024

Thank you for let me know that. Your reccommendation seem tobe possible. I'm noob in emacs lisp but I miss that kind of feature. I did some modifications with this minimap-mode to be able to see search results throught the minimap (while long scrolling). But I also hope the feature you suggested or somethings like that could be implemented. (Please close this if you need)

@jdtsmith jdtsmith added the help wanted Extra attention is needed label May 28, 2024
@jdtsmith
Copy link
Owner

I will think about how it might be done (these are notes to myself or anyone else who wants to give it a try).

In principle it's "easy" to set a display property for each specified space. Nested display properties don't work correctly in emacs, however, so this makes it much more challenging. When a search is active (also other things? consult-line for example?) you'd need to use an arbitrary number of spaces. You'd also have to decide on a minimum "search indicator" width, and come up with an algorithm to "merge" matches which are too close together to count as separate. Then you'd draw, instead of 3 specified spaces, N specified spaces, and instead of two styles, four possible styling choices: on-bar/off-bar/on-bar-search/off-bar-search. Since bar width depends on lines showing, not chars showing, you now need the line number of each search term, which could be a performance problem; probably would need to turn off line-based bar size indication for this to work well. This is particularly important when much of the buffer is hidden, as if often the case in org-mode.

@jdtsmith jdtsmith added the enhancement New feature or request label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants