Skip to content

Commit

Permalink
undo: micro optim
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Jun 5, 2020
1 parent 3c43e12 commit 65879b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions atsynedit/atstrings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1640,8 +1640,13 @@ procedure TATStrings.DoUndoSingle(ACurList: TATUndoList;
ASoftMarked:= Item.ItemSoftMark;
AHardMarked:= Item.ItemHardMark;
NCount:= ACurList.Count;
AHardMarkedNext:= (NCount>1) and (ACurList[NCount-2].ItemHardMark);
AUnmodifiedNext:= (NCount>1) and (ACurList[NCount-2].ItemAction=aeaClearModified);

if NCount>1 then
with ACurList[NCount-2] do
begin
AHardMarkedNext:= ItemHardMark;
AUnmodifiedNext:= ItemAction=aeaClearModified;
end;

//don't undo if one item left: unmodified-mark
if ACurList.IsEmpty then exit;
Expand Down

0 comments on commit 65879b1

Please sign in to comment.