From f892194be4c39a49d2dba5d1affc3bbe4dfa7f8e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 21 Jun 2023 23:41:17 +0100 Subject: [PATCH] Don't reset page unless we have to. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15033 --- eeschema/schematic_undo_redo.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp index 093daf2b53..391f41e2ca 100644 --- a/eeschema/schematic_undo_redo.cpp +++ b/eeschema/schematic_undo_redo.cpp @@ -311,8 +311,13 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) } else if( status == UNDO_REDO::PAGESETTINGS ) { - SetCurrentSheet( *m_schematic->GetSheets().FindSheetForScreen( screen ) ); - DisplayCurrentSheet(); + SCH_SHEET_PATH& undoSheet = *m_schematic->GetSheets().FindSheetForScreen( screen ); + + if( GetCurrentSheet() != undoSheet ) + { + SetCurrentSheet( undoSheet ); + DisplayCurrentSheet(); + } // swap current settings with stored settings DS_PROXY_UNDO_ITEM alt_item( this );