mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 18:49:19 +02:00
cody: insert inherited call: begin/endundoblock
git-svn-id: trunk@34242 -
This commit is contained in:
parent
ae11c87ef7
commit
94417f1fe6
@ -287,15 +287,20 @@ begin
|
||||
// move editor cursor in front of insert position
|
||||
NewXY:=Point(GetPosInLine(Tool.Src,FromPos)+1,SrcEdit.CursorTextXY.Y);
|
||||
//debugln(['InsertCallInherited NewXY=',dbgs(NewXY),' FromPos=',Tool.CleanPosToStr(FromPos),' ToPos=',Tool.CleanPosToStr(ToPos)]);
|
||||
SrcEdit.CursorTextXY:=NewXY;
|
||||
if not CodeToolBoss.SourceChangeCache.Replace(Gap,Gap,FromPos,ToPos,NewCode)
|
||||
then begin
|
||||
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Replace failed']);
|
||||
exit;
|
||||
end;
|
||||
if not CodeToolBoss.SourceChangeCache.Apply then begin
|
||||
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Apply failed']);
|
||||
exit;
|
||||
SrcEdit.BeginUndoBlock;
|
||||
try
|
||||
SrcEdit.CursorTextXY:=NewXY;
|
||||
if not CodeToolBoss.SourceChangeCache.Apply then begin
|
||||
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Apply failed']);
|
||||
exit;
|
||||
end;
|
||||
finally
|
||||
SrcEdit.EndUndoBlock;
|
||||
end;
|
||||
except
|
||||
on e: Exception do CodeToolBoss.HandleException(e);
|
||||
|
Loading…
Reference in New Issue
Block a user