diff --git a/src/gui/commandPalette.cpp b/src/gui/commandPalette.cpp index 7bd29def1..532dc48a3 100644 --- a/src/gui/commandPalette.cpp +++ b/src/gui/commandPalette.cpp @@ -121,10 +121,7 @@ void FurnaceGUI::drawPalette() { if (curPaletteChoice>=(int)paletteSearchResults.size()) { curPaletteChoice=paletteSearchResults.size()-1; } - if (ImGui::IsKeyPressed(ImGuiKey_Enter)) { - // TODO: properly test this - what happens when enter is pressed and the list is empty? - accepted=true; - } + accepted=ImGui::IsKeyPressed(ImGuiKey_Enter); } if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { @@ -132,28 +129,31 @@ void FurnaceGUI::drawPalette() { } if (accepted) { - int i=paletteSearchResults[curPaletteChoice]; - - switch (curPaletteType) { - case CMDPAL_TYPE_MAIN: - resetPalette(this); - doAction(i); - if (i