-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Highlight matches of consult-lines
in buffer
#253
Comments
Yes, this is a known issue. I personally don't need this feature, since I am happy with the minibuffer view in combination with preview when scrolling through the matches. Only very few matches may be visible in the buffer, many more will lie outside the visible region. Furthermore there are faster solutions if you want to jump to matches within the visible region, e.g. isearch, avy etc. The strength of swiper/consult-line is the overview. The problem has been that the implementation of this feature is a bit intricate since we are using the completion styles to perform the filtering. This means we also have to rely on the completion style to obtain the highlighting. There is 1. either the possibility to use the filtered strings (propertized by the completion style) and use them as overlays or 2. somehow extract the positions of the matches by looking for the completion style faces. Option 2 is problematic since the completion styles can define their own faces such that there is no consistency one could rely on. If someone proposes a patch I would be happy to merge it. |
I would like to suggest an alternative in solving this issue (which in return would solve mine ...) I have written a couple utility ripgrep and swipe-like function with I think this way OP can, assumably that isearch would provide a good navigation interface (I do not use isearch, but instead the evil-mode search, so again it's an assumption made here), navigate the matches quickly. |
The situation regarding highlighting improved a bit with #281, since we only highlight the current visual line with the match. But there is still no solution for highlighting the matches of all lines in sight. Closing for now due to interactivity and since there is no intention to implement this. If someone comes forward with a good idea on how to implement the feature (or even better a patch!) we can reconsider. |
Perhaps this could be implemented generally by supporting previewing multiple candidates? The read would specify a function that returns the subset of candidates to preview. For consult-line, the function would yield visible candidates. May not be applicable to many reads other than those that deal with lines in file(s). |
This is a generalization which is too difficult and goes too far. The alternative would be to special case the multi preview only for consult-line. Personally I am happy with the status quo, but of course feel free to experiment. |
Tweak the list of line matches to optionally also include other lines' matches. I didn't enable by default because it is noticeably slower in large buffers. It's tricky to avoid O(n^2) pitfalls due to the contortions required to detect and propagate the matches. Updates minad#253
Currently the matches of
consult-lines
are not highlighted in the original buffer. Sometimes it's a bit hard to locate the matches, i.e. when the matched line is long. Besides, when using commands likeconsult-lines
orswiper
, I personally focus on the buffer lines rather than the minibuffer because the lines around the matches provide more context than the individual match lines as shown in the minibuffer.Is it possible to have highlights in the buffer line? Thanks.
consult-lines
swiper
isearch-forward
The text was updated successfully, but these errors were encountered: