mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
File / path and command fuzzy match improvements.
This commit is contained in:
@@ -75,8 +75,8 @@ CommandPalette::fuzzyMatch( const std::vector<std::vector<std::string>>& cmdPale
|
||||
std::vector<std::vector<std::string>> ret;
|
||||
|
||||
for ( size_t i = 0; i < cmdPalette.size(); i++ ) {
|
||||
int matchName = String::fuzzyMatch( cmdPalette[i][0], match );
|
||||
int matchKeybind = String::fuzzyMatch( cmdPalette[i][2], match );
|
||||
int matchName = String::fuzzyMatch( cmdPalette[i][0], match, true );
|
||||
int matchKeybind = String::fuzzyMatch( cmdPalette[i][2], match, true );
|
||||
matchesMap.insert( { std::max( matchName, matchKeybind ), i } );
|
||||
}
|
||||
for ( auto& res : matchesMap ) {
|
||||
|
||||
@@ -118,8 +118,8 @@ ProjectDirectoryTree::fuzzyMatchTree( const std::vector<std::string>& matches, c
|
||||
std::vector<std::string> names;
|
||||
for ( const auto& match : matches ) {
|
||||
for ( size_t i = 0; i < mNames.size(); i++ ) {
|
||||
int matchName = String::fuzzyMatch( mNames[i], match );
|
||||
int matchPath = String::fuzzyMatch( mFiles[i], match );
|
||||
int matchName = String::fuzzyMatch( match, mNames[i], true );
|
||||
int matchPath = String::fuzzyMatch( match, mFiles[i], true );
|
||||
matchesMap.insert( { std::max( matchName, matchPath ), i } );
|
||||
}
|
||||
}
|
||||
@@ -144,8 +144,8 @@ ProjectDirectoryTree::fuzzyMatchTree( const std::string& match, const size_t& ma
|
||||
std::vector<std::string> files;
|
||||
std::vector<std::string> names;
|
||||
for ( size_t i = 0; i < mNames.size(); i++ ) {
|
||||
int matchName = String::fuzzyMatch( mNames[i], match );
|
||||
int matchPath = String::fuzzyMatch( mFiles[i], match );
|
||||
int matchName = String::fuzzyMatch( match, mNames[i], true );
|
||||
int matchPath = String::fuzzyMatch( match, mFiles[i], true );
|
||||
matchesMap.insert( { std::max( matchName, matchPath ), i } );
|
||||
}
|
||||
for ( auto& res : matchesMap ) {
|
||||
|
||||
@@ -94,7 +94,7 @@ LSPSymbolInformationList fuzzyMatchTextDocumentSymbol( const LSPSymbolInformatio
|
||||
std::map<int, LSPSymbolInformation, std::greater<int>> matchesMap;
|
||||
|
||||
for ( const auto& l : list ) {
|
||||
int matchName = String::fuzzyMatch( l.name, query );
|
||||
int matchName = String::fuzzyMatch( l.name, query, true );
|
||||
matchesMap.insert( { matchName, l } );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user