Get list of highlighted things from mini.highpattern #518
-
One think I really like about folke's todo-comments is the ability to put todos in a quickfix list or telescope finder. I ended up writing my own mini.pick finder that lets me choose todos from todo-comments. Would it be possible to get a list of matched items for a given set of highlighters from mini.hipatterns? Once the list of matches (plus location) is in hand its easy enough to pipe them to mini.pick or a qf list or whatever. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Yeah, this is possible, but on a more low level. All highlighting is done via extmarks (see I think the best approach here would be to fix and "export" namespace name to allow this kind of manipulations. |
Beta Was this translation helpful? Give feedback.
-
@BeauSLM, thanks again for the suggestion! It prompted me thinking about the best way to do this, and after couple of refactor rounds this is now possible with As a heads up, here is how it can be used in a picker (which will be a part of an upcoming 'mini.extra' module): |
Beta Was this translation helpful? Give feedback.
-
One usecase I imagined for a feature like this is "hunting" for todos in the project, e.g. trying to fix all todos before a release or something like that. However this would require a project-wide search (backed by ripgrep or something), which seems like its out of the scope of what I'm honestly not sure how something like this could be supported, thoughts? |
Beta Was this translation helpful? Give feedback.
@BeauSLM, thanks again for the suggestion! It prompted me thinking about the best way to do this, and after couple of refactor rounds this is now possible with
get_matches()
.As a heads up, here is how it can be used in a picker (which will be a part of an upcoming 'mini.extra' module):