From 3ca72f91d33c2a5486c392eeddb0e06909f008bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Tue, 30 Sep 2025 01:26:28 -0300 Subject: [PATCH] Remove duplicate entries in command palette (SpartanJ/ecode#680). --- src/tools/ecode/commandpalette.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/ecode/commandpalette.cpp b/src/tools/ecode/commandpalette.cpp index 01abc6193..912d51e48 100644 --- a/src/tools/ecode/commandpalette.cpp +++ b/src/tools/ecode/commandpalette.cpp @@ -7,6 +7,9 @@ CommandPalette::build( const std::vector& commandList, const EE::UI::KeyBindings& keybindings ) { std::vector> ret; for ( const auto& cmd : commandList ) { + if ( std::find_if( ret.begin(), ret.end(), + [&cmd]( const auto& other ) { return other[2] == cmd; } ) != ret.end() ) + continue; std::string cmdName( cmd ); String::capitalizeInPlace( cmdName ); String::replaceAll( cmdName, "-", " " );