Skip to content

Commit

Permalink
Fix command reordering bug (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansen4857 authored Oct 14, 2023
1 parent d8d8b89 commit a0184fe
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ class CommandGroupWidget extends StatelessWidget {
},
itemCount: command.commands.length,
onReorder: (oldIndex, newIndex) {
// The fact that this needs to be here is so dumb
if (newIndex >= command.commands.length) {
newIndex = command.commands.length - 1;
if (oldIndex < newIndex) {
newIndex -= 1;
}

undoStack.add(Change(
Expand Down

0 comments on commit a0184fe

Please sign in to comment.