mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-29 17:46:29 +03:00
Fix fuzzy search for keys in commnad palette.
Fix in premake4 project file.
This commit is contained in:
@@ -75,15 +75,13 @@ 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][1], match );
|
||||
int matchName = String::fuzzyMatch( cmdPalette[i][0], match, true, true );
|
||||
int matchKeybind = String::fuzzyMatch( cmdPalette[i][2], match, true, true );
|
||||
matchesMap.insert( { std::max( matchName, matchKeybind ), i } );
|
||||
}
|
||||
for ( auto& res : matchesMap ) {
|
||||
if ( ret.size() < max ) {
|
||||
ret.push_back( { cmdPalette[res.second][0], cmdPalette[res.second][1],
|
||||
cmdPalette[res.second][2] } );
|
||||
}
|
||||
if ( ret.size() < max )
|
||||
ret.push_back( cmdPalette[res.second] );
|
||||
}
|
||||
return CommandPaletteModel::create( 3, ret );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user