mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-21 12:09:30 +01: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
|
// move editor cursor in front of insert position
|
||||||
NewXY:=Point(GetPosInLine(Tool.Src,FromPos)+1,SrcEdit.CursorTextXY.Y);
|
NewXY:=Point(GetPosInLine(Tool.Src,FromPos)+1,SrcEdit.CursorTextXY.Y);
|
||||||
//debugln(['InsertCallInherited NewXY=',dbgs(NewXY),' FromPos=',Tool.CleanPosToStr(FromPos),' ToPos=',Tool.CleanPosToStr(ToPos)]);
|
//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)
|
if not CodeToolBoss.SourceChangeCache.Replace(Gap,Gap,FromPos,ToPos,NewCode)
|
||||||
then begin
|
then begin
|
||||||
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Replace failed']);
|
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Replace failed']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if not CodeToolBoss.SourceChangeCache.Apply then begin
|
SrcEdit.BeginUndoBlock;
|
||||||
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Apply failed']);
|
try
|
||||||
exit;
|
SrcEdit.CursorTextXY:=NewXY;
|
||||||
|
if not CodeToolBoss.SourceChangeCache.Apply then begin
|
||||||
|
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Apply failed']);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
SrcEdit.EndUndoBlock;
|
||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
on e: Exception do CodeToolBoss.HandleException(e);
|
on e: Exception do CodeToolBoss.HandleException(e);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user