Hi, On Wed, Dec 23, 2020 at 4:45 AM lacygoill <[email protected]> wrote:
> @yegappan <https://github.com/yegappan> I haven't had the time to write a > proper feature request, but I think it would be useful for matchfuzzypos() > to also give the score for each string. > Currently matchfuzzypos() function returns two lists. One with the list of matching strings and the other with the list of matching character positions. To return the matching scores, we need to add one more list to the result. Will that work? Regards, Yegappan Rationale: Inevitably, for some big enough lists, the function gets slow. > This is a problem when implementing an interactive fuzzy command. The user > expects to be able to type immediately. To get around that, we can break > the list into smaller chunks, process a chunk, then start a short timer to > process the next one. This way, the user can still type while Vim is > filtering the list. > > But this creates an issue: the final sorting is messed up, because you're > not filtering the original list; you're filtering chunks, then > concatenating the results; that's not the same thing. To fix this, we can > run matchfuzzypos() a second time on the result. But the same issue might > arise. That is, the filtered list might be still too big. OTOH, if we had > the scores, we could use the information in a sort() invocation and fix > the sorting. It might be still too slow for some huge lists, but I assume > it would be still faster than a second matchfuzzypos() invocation. > > Alternatively, we would need to be able to start a Vim function > asynchronously <https://www.youtube.com/watch?v=ES1L2SPgIDI&t=1390s>. > Unfortunately, this would probably be too much work. Just for future > reference, I *think* Neovim is working on this feature in this PR > <https://github.com/neovim/neovim/pull/10843>. > > > -- -- 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/CAAW7x7m0hpNAEg-zU7GeP%2B%3DgPg5P%2Bq_bgvzU0mX6%2Brb04Pr2NQ%40mail.gmail.com.
