-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ranked match: prefer when each path component matches within a path component #5033
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
#include "string.hh" | ||
#include "meta.hh" | ||
#include "vector.hh" | ||
|
||
#include <cstdint> | ||
|
||
|
@@ -52,6 +53,7 @@ private: | |
StringView m_candidate{}; | ||
bool m_matches = false; | ||
Flags m_flags = Flags::None; | ||
Vector<RankedMatch, MemoryDomain::RankedMatch> m_path_component_matches; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If these semantics are okay we could get rid of this allocation by computing the path component matches lazily in |
||
int m_word_boundary_match_count = 0; | ||
int m_max_index = 0; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably if we use the same recursive-matching for the basename (even if the query contains no slash) then we can make @raiguard's test work:
kak_assert(preferred("luaremote", "src/script/LuaRemote.cpp", "tests/TestLuaRemote.cpp"));
because
luaremote
is a prefix (or is it?) of the basename so the RankedMatch will win