mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 08:09:26 +02:00
IDE: code templates: fixed auto indent for middle space
git-svn-id: trunk@28970 -
This commit is contained in:
parent
2b72e682a8
commit
f4ecc0e4f7
@ -296,6 +296,7 @@ const
|
||||
);
|
||||
|
||||
function ProcHeadAttributesToStr(Attr: TProcHeadAttributes): string;
|
||||
function dbgs(Attr: TProcHeadAttributes): string; overload;
|
||||
|
||||
|
||||
implementation
|
||||
@ -318,6 +319,11 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function dbgs(Attr: TProcHeadAttributes): string;
|
||||
begin
|
||||
Result:=ProcHeadAttributesToStr(Attr);
|
||||
end;
|
||||
|
||||
{ TPascalParserTool }
|
||||
|
||||
constructor TPascalParserTool.Create;
|
||||
|
@ -212,6 +212,7 @@ const
|
||||
var
|
||||
IndentLevel: Integer;
|
||||
LastLineIndent: Integer;
|
||||
IsLineStart: boolean;
|
||||
|
||||
procedure AppentToDest(S: String);
|
||||
var
|
||||
@ -232,14 +233,14 @@ var
|
||||
FDestTemplate := FDestTemplate + copy(s, LastCopy, i - LastCopy) + FIndent;
|
||||
LastCopy := i;
|
||||
FDestPosX := 1 + length(FIndent);
|
||||
IsLineStart:=true;
|
||||
inc(FDestPosY);
|
||||
end;
|
||||
else // case else
|
||||
begin
|
||||
if (s[i] in [' ',#9])
|
||||
and (not KeepSubIndent)
|
||||
and (FDestTemplate<>'')
|
||||
and ((i=1) or (S[i-1] in [#10,#13]))
|
||||
and ((FDestTemplate<>'') and IsLineStart)
|
||||
then begin
|
||||
// space at start of template line (not first line)
|
||||
FDestTemplate:=FDestTemplate+copy(S,LastCopy,i-LastCopy);
|
||||
@ -270,6 +271,7 @@ var
|
||||
inc(i);
|
||||
inc(FDestPosX);
|
||||
end;
|
||||
IsLineStart:=false;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -303,6 +305,7 @@ begin
|
||||
len:=length(Template);
|
||||
IndentLevel:=0;
|
||||
LastLineIndent:=0;
|
||||
IsLineStart:=false;
|
||||
while p <= len do begin
|
||||
case Template[p] of
|
||||
'$':
|
||||
|
@ -363,7 +363,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
//debugln('CodeMacroProcedureHead B ');
|
||||
//debugln('CodeMacroProcedureHead B ',dbgs(Attributes));
|
||||
if not CodeToolBoss.ExtractProcedureHeader(
|
||||
SrcEdit.CodeToolsBuffer as TCodeBuffer,
|
||||
SrcEdit.CursorTextXY.X,SrcEdit.CursorTextXY.Y,Attributes,Value) then
|
||||
|
Loading…
Reference in New Issue
Block a user