diff --git a/lib/macro/macro-selection.cpp b/lib/macro/macro-selection.cpp index 08e22256..7625cffa 100644 --- a/lib/macro/macro-selection.cpp +++ b/lib/macro/macro-selection.cpp @@ -76,12 +76,16 @@ void MacroSelection::ShowAllMacros() void MacroSelection::MacroRemove(const QString &name) { + const bool currentSelectionWasRemoved = name == currentText(); + int idx = findText(name); if (idx == -1) { return; } removeItem(idx); - setCurrentIndex(-1); + if (currentSelectionWasRemoved) { + setCurrentIndex(-1); + } } void MacroSelection::MacroRename(const QString &oldName, const QString &newName)