mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 14:39:13 +02:00
forward proc completion no longer copies comments
git-svn-id: trunk@7515 -
This commit is contained in:
parent
0b9be2f264
commit
98910ff579
@ -2373,20 +2373,20 @@ var CleanCursorPos, Indent, insertPos: integer;
|
|||||||
ProcCode:=ExtractProcHead(CurProcNode,[phpWithStart,
|
ProcCode:=ExtractProcHead(CurProcNode,[phpWithStart,
|
||||||
phpWithoutClassKeyword,
|
phpWithoutClassKeyword,
|
||||||
phpWithVarModifiers,phpWithParameterNames,phpWithResultType,
|
phpWithVarModifiers,phpWithParameterNames,phpWithResultType,
|
||||||
phpWithComments,phpWithCallingSpecs]);
|
phpWithCallingSpecs]);
|
||||||
if ProcCode='' then
|
if ProcCode='' then
|
||||||
RaiseException('unable to parse forward proc node');
|
RaiseException('CompleteForwardProcs: unable to parse forward proc node');
|
||||||
ProcCode:=SourceChangeCache.BeautifyCodeOptions.BeautifyProc(ProcCode,
|
ProcCode:=SourceChangeCache.BeautifyCodeOptions.BeautifyProc(ProcCode,
|
||||||
Indent,true);
|
Indent,true);
|
||||||
if not SourceChangeCache.Replace(gtEmptyLine,gtEmptyLine,
|
if not SourceChangeCache.Replace(gtEmptyLine,gtEmptyLine,
|
||||||
InsertPos,InsertPos,ProcCode) then
|
InsertPos,InsertPos,ProcCode) then
|
||||||
RaiseException('unable to insert new proc body');
|
RaiseException('CompleteForwardProcs: unable to insert new proc body');
|
||||||
// next
|
// next
|
||||||
if CurProcNode=EndProcNode then break;
|
if CurProcNode=EndProcNode then break;
|
||||||
CurProcNode:=FindNextNodeOnSameLvl(CurProcNode);
|
CurProcNode:=FindNextNodeOnSameLvl(CurProcNode);
|
||||||
until false;
|
until false;
|
||||||
if not SourceChangeCache.Apply then
|
if not SourceChangeCache.Apply then
|
||||||
RaiseException('unable to apply changes');
|
RaiseException('CompleteForwardProcs: unable to apply changes');
|
||||||
|
|
||||||
// reparse code and find jump point into new proc
|
// reparse code and find jump point into new proc
|
||||||
Result:=FindJumpPoint(CursorPos,NewPos,NewTopLine,RevertableJump);
|
Result:=FindJumpPoint(CursorPos,NewPos,NewTopLine,RevertableJump);
|
||||||
|
Loading…
Reference in New Issue
Block a user