Yegappan Lakshmanan wrote: > The matchfuzzy() function uses the standard C library qsort() function to > sort the > matches by score. The qsort() function is not guaranteed to be stable as > explained > in the following page; > > https://nullprogram.com/blog/2014/08/29/#:~:text=Since%20quicksort%20is%20an%20unstable,has%20no%20stable%20sort%20function. > > So the list of strings passed to the matchfuzzy() function with the same > matching > score are not guaranteed to retain the same order in the returned list.
qsort() is not stable, but can't we have a tie-breaker in its comparator fuzzy_item_compare() to make it stable when multiple entries have the same score? (e.g. when scores are equal, compare by string). Regards Dominique -- -- 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/CAON-T_iw4omEXSZtsxjG%3D2nc9Rp-L-jj_vcCf2G5O0%2BOnCkWxg%40mail.gmail.com.
