Open wbthomason opened 3 years ago
Yep, was just thinking of something similar related to this suggestion. Would also be nice to apply some form of sed to results. i.e sed s/\/Users\/admin\/.dotfiles\/nvim\///
So that you only get the filenames in the list not the paths.
I tried looking around but not sure if this is doable right now without some hacking around.
I'm definitely going to implement this, just need some time.
Wonderful. Things are moving along great no rush mate!
@wbthomason Seems like a reasonable approach to me. We could add a display
function to each meta result, and on around here: https://github.com/camspiers/snap/blob/main/fnl/snap/init.fnl#L293 call it if it exists instead of calling tostring
on the table. The way we call it will be like how we call the positions function if it exists here: https://github.com/camspiers/snap/blob/main/fnl/snap/init.fnl#L330
@wbthomason If you want to work on it please feel free!
I started on something in #47; however, there are still a few bugs remaining with it.
What do you think of adding a mechanism for rendering decorations (e.g. devicons, a score display, etc.) next to results of producers?
I took a stab at a hacky way of implementing this for devicons, which almost works:
However, the previewer wrapped with
icon_remover
doesn't display anything, and it seems hacky to tack on and then remove the symbol to get e.g. the viewer, selecter, etc. to work correctly.One thought is that there could be a special metadata item "decorations" or "decorator" - either a table of strings or a function taking a string or
MetaResult
as its argument - which the results display runs to get the "rendered" version of each result (which could naturally be cached for performance), without modifying the actual text of the result (as passed to aViewProducer
viarequest.selection
, etc.)Does that seem like something you'd like to add to
snap
/a reasonable approach to doing this?