forward proc completion no longer copies comments

git-svn-id: trunk@7515 -
This commit is contained in:
mattias 2005-08-17 09:15:01 +00:00
parent 0b9be2f264
commit 98910ff579

View File

@ -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);