Hi,
On Mon, Sep 14, 2020 at 12:52 PM Prabir Shrestha <[email protected]>
wrote:
> matchfuzzypos sounds good to me. Thought I would prefer different type
> for results.
>
> [
> \ ['string1', 'string2'],
> \ [ [[0, 2, 4]], [[1,3,5]] ]
> \ ]
>
> or
>
> {
> \ 'items': ['string1', 'string2'],
> \ 'highlights': [ [[0, 2, 4]], [[1,3,5]] ]
> \ }
>
> This allows me to avoid loop in vimscript and use c instead. Also allows
> me to improve rendering perf by virtualizing highlights.
>
You cannot avoid a loop in vimscript to process the results. For example,
to highlight
the matching characters, you need to loop through the various matching
positions for
each match.
For now, I have implemented the new function to produce the output like the
above (first
suggestion). The user needs to extract the matching positions for a given
string from the
corresponding index in the second list.
Any comments about this output format for this new function from others?
- Yegappan
> let [items, highlightpos] = matchfuzzypos(['foo', 'foobar', 'bar'],
> 'foo')call setline(1, items)" calc visible lines and only highlight what is
> visible in screen
>
>
>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAAW7x7%3DGnnYUaNkt38xghre%2Bha2QmnT0WC%2BtbidF74FCBjvVDw%40mail.gmail.com.