diff --git a/atsynedit/atstrings.pas b/atsynedit/atstrings.pas index 15e7ddb59..d34169fd0 100644 --- a/atsynedit/atstrings.pas +++ b/atsynedit/atstrings.pas @@ -1619,6 +1619,7 @@ procedure TATStrings.DoUndoSingle(ACurList: TATUndoList; ALineState: TATLineState; ACarets: TATPointArray; NCount: integer; + OtherList: TATUndoList; begin ASoftMarked:= true; AHardMarked:= false; @@ -1642,6 +1643,11 @@ procedure TATStrings.DoUndoSingle(ACurList: TATUndoList; AHardMarkedNext:= (NCount>1) and (ACurList[NCount-2].ItemHardMark); AUnmodifiedNext:= (NCount>1) and (ACurList[NCount-2].ItemAction=aeaClearModified); + if ACurList=FUndoList then + OtherList:= FRedoList + else + OtherList:= FUndoList; + //don't undo if one item left: unmodified-mark if ACurList.IsEmpty then exit; @@ -1680,11 +1686,7 @@ procedure TATStrings.DoUndoSingle(ACurList: TATUndoList; aeaClearModified: begin - //add unmodified mark to undo/redo - if ACurList=FUndoList then - FRedoList.AddUnmodifiedMark - else - FUndoList.AddUnmodifiedMark; + OtherList.AddUnmodifiedMark; exit; end