Skip to content

Commit 3ca72f9

Browse files
committed
Remove duplicate entries in command palette (SpartanJ/ecode#680).
1 parent 3248543 commit 3ca72f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tools/ecode/commandpalette.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ CommandPalette::build( const std::vector<std::string>& commandList,
77
const EE::UI::KeyBindings& keybindings ) {
88
std::vector<std::vector<std::string>> ret;
99
for ( const auto& cmd : commandList ) {
10+
if ( std::find_if( ret.begin(), ret.end(),
11+
[&cmd]( const auto& other ) { return other[2] == cmd; } ) != ret.end() )
12+
continue;
1013
std::string cmdName( cmd );
1114
String::capitalizeInPlace( cmdName );
1215
String::replaceAll( cmdName, "-", " " );

0 commit comments

Comments
 (0)