zot / microfts

Small and fast FTS (full text search)
MIT License
32 stars 3 forks source link

Feature request - one line per search result for completion tools in Emacs #2

Closed jkitchin closed 3 years ago

jkitchin commented 3 years ago

To use asynchronous search with completion tools like ivy/helm, we need the search command to output one complete line per result. I think you want something like:

(:filename path :line line-number :offset integer :text "matched chunk" :percent float)

I used a plist there, but other forms would work too, as long as you can "read" them in emacs.

for each match. Then you can use a transformer function in ivy to convert that to what you want to do completion on.

Note this is already supported in the vanilla search output which does output a line per result, but you have to parse that line to use it, and that isn't as reliable as using read in emacs. Also, it only outputs the line number so you can't jump to the match with offset.

zot commented 3 years ago

note to self: