summaryrefslogtreecommitdiff
path: root/src/ranked_match.hh
AgeCommit message (Collapse)Author
2025-04-02Tweak ranked match behaviour to consider the number of full wordsMaxime Coste
Tracking the number of query words that appear as full words in the candidate seems to fix a few cases where the existing fuzzy matching algorithm was not great. I have been running with this for a while and did not notice any annoyances, the whole RankedMatch code probably deserves more attention but this seems to go in the right direction.
2023-12-02ranked match: prefer input order over alphabetical order for user-specified ↵Johannes Altmanninger
completions When using either of set-option g completers option=my_option prompt -shell-script-candidates ... While the search text is empty, the completions will be sorted alphabetically. This is bad because it means the most important entries are not listed first, making them harder to select or even spot. Let's apply input order before resorting to sorting alphabetically. In theory there is a more elegant solution: sort candidates (except if they're user input) before passing them to RankedMatch, and then always use stable sort. However that doesn't work because we use a heap which doesn't support stable sort. Closes #1709, #4813
2023-11-15Refactor fuzzy matcher ranking furtherMaxime Coste
Remove FirstCharMatch which does not impact any of the test cases and explicitely detect paths by using a BaseName flag when we match the basename of the path.
2023-02-28Fix new gcc errors for missing types.ioh
Errors when building with gcc 13: ranked_match.hh:10:21: error: ‘uint64_t’ does not name a type 10 | using UsedLetters = uint64_t; | ^~~~~~~~
2022-11-19Accept "cd dir/" again instead of using a subdirectoryJohannes Altmanninger
Commit 69053d962 (Use menu behavior when completing change-directory, 2022-07-19) made ":cd dir/" actually run ":cd dir/first-subdir", which can be surprising. This is usually irrelevant because you rarely type the trailing slash. However it does happen after correcting an error with `<backspace>` and friends. For for example, :cd d<tab>/f<backspace> results in :cd dir/ We should probably fix user expectations here. Do this by adding "dir/" as valid completion. This requires us to allow empty candidates in "RankedMatch" but there's no harm in that. This means we need to filter out empty completions from shell-script-candidates elsewhere. Alternative fix: we could revert 69053d962. This would remove the convenient menu behavior but that wouldn't be a huge deal. Fixes #4775
2017-07-19Make non smart case full match better than smart case full matchMaxime Coste
2017-03-15Migrate WithBitOps template specialization to with_bit_ops functionMaxime Coste
This way we dont depend on knowing the base template to enable bit ops on an enum type.
2017-01-29Make StringView and unit types trivial typesMaxime Coste
2016-11-28Cleanup include dependencies a bitMaxime Coste
2016-11-14Tweak RankedMatch behaviour and fix bug in its comparison functionMaxime Coste
casting TestableFlag<T> to UnderlyingType<T> was going through bool conversion... Not sure how things worked earlier.
2016-09-30Tweak ranked match comparison, give contiguous matches an edgeMaxime Coste
2016-09-26Tweak RankedMatch logic, prioritize matches that are in a single wordMaxime Coste
2016-08-30Tweak RankedMatch, compare max match index instead of match indices sumMaxime Coste
2016-08-29Use flags and bit operations instead of bools in RankedMatchMaxime Coste
full match is now the most important flag for comparison.
2016-03-25Move UsedLetters with RankedMatchMaxime Coste
2016-03-24Fix uninitialized value in RankedMatchMaxime Coste
2016-02-28Take subsequence matches index when sorting RankedMatchMaxime Coste
2016-01-28Small cleanupMaxime Coste
2015-10-29Use an heuristic based match ranking algorithm inspired by what ↵Maxime Coste
YouCompleteMe does
2015-10-27Move more logic into RankedMatchMaxime Coste
2015-10-22Extract WordDB::RankedWord as RankedMatch in its own fileMaxime Coste