From be6bc48231ce22a1bcfa001a399afadd97c26377 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Tue, 10 Jun 2025 21:54:13 +0200 Subject: [PATCH] Fix macro selection resetting when any macro was removed --- lib/macro/macro-selection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)