mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 22:39:14 +02:00
SynEdit: Cleanup calls to Fold.(Un)Lock - they are done in Inc/DecPaintlock
git-svn-id: trunk@63421 -
This commit is contained in:
parent
8d1a8ad4fe
commit
6b88883112
@ -2658,7 +2658,7 @@ begin
|
|||||||
FMarkupManager.IncPaintLock;
|
FMarkupManager.IncPaintLock;
|
||||||
end;
|
end;
|
||||||
inc(FPaintLock);
|
inc(FPaintLock);
|
||||||
FFoldedLinesView.Lock; //DecPaintLock triggers ScanFrom, and folds must wait
|
FFoldedLinesView.Lock; //DecPaintLock triggers ScanRanges, and folds must wait
|
||||||
FTrimmedLinesView.Lock; // Lock before caret
|
FTrimmedLinesView.Lock; // Lock before caret
|
||||||
FBlockSelection.Lock;
|
FBlockSelection.Lock;
|
||||||
FCaret.Lock;
|
FCaret.Lock;
|
||||||
@ -2696,7 +2696,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// When fixed FCaret, FBlockSelection, FTrimmedLinesView can move here
|
// When fixed FCaret, FBlockSelection, FTrimmedLinesView can move here
|
||||||
FFoldedLinesView.UnLock; // after ScanFrom, but before UpdateCaret
|
FFoldedLinesView.UnLock; // after ScanRanges, but before UpdateCaret
|
||||||
|
// must be last => May call MoveCaretToVisibleArea, which must only happen
|
||||||
|
// after unfold
|
||||||
|
|
||||||
Dec(FPaintLock);
|
Dec(FPaintLock);
|
||||||
if (FPaintLock = 0) and HandleAllocated then begin
|
if (FPaintLock = 0) and HandleAllocated then begin
|
||||||
@ -7678,17 +7680,11 @@ begin
|
|||||||
aList.OnNeedCaretUndo := @GetCaretUndo;
|
aList.OnNeedCaretUndo := @GetCaretUndo;
|
||||||
aList.BeginBlock;
|
aList.BeginBlock;
|
||||||
IncPaintLock;
|
IncPaintLock;
|
||||||
FFoldedLinesView.Lock;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomSynEdit.InternalEndUndoBlock(aList: TSynEditUndoList);
|
procedure TCustomSynEdit.InternalEndUndoBlock(aList: TSynEditUndoList);
|
||||||
begin
|
begin
|
||||||
if aList = nil then aList := fUndoList;
|
if aList = nil then aList := fUndoList;
|
||||||
// Write all trimming info to the end of the undo block,
|
|
||||||
// so it will be undone first, and other UndoItems do see the expected spaces
|
|
||||||
FFoldedLinesView.UnLock;
|
|
||||||
// must be last => May call MoveCaretToVisibleArea, which must only happen
|
|
||||||
// after unfold
|
|
||||||
DecPaintLock;
|
DecPaintLock;
|
||||||
aList.EndBlock; // Todo: Doing this after DecPaintLock, can cause duplicate calls to StatusChanged(scModified)
|
aList.EndBlock; // Todo: Doing this after DecPaintLock, can cause duplicate calls to StatusChanged(scModified)
|
||||||
{$IFDEF SynUndoDebugBeginEnd}
|
{$IFDEF SynUndoDebugBeginEnd}
|
||||||
@ -7704,7 +7700,6 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
fUndoList.OnNeedCaretUndo := @GetCaretUndo;
|
fUndoList.OnNeedCaretUndo := @GetCaretUndo;
|
||||||
fUndoList.BeginBlock;
|
fUndoList.BeginBlock;
|
||||||
////FFoldedLinesView.Lock;
|
|
||||||
//FTrimmedLinesView.Lock;
|
//FTrimmedLinesView.Lock;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user