mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 06:09:14 +02:00
codetools: auto indent: on paste: skip spaces in insert code
git-svn-id: trunk@22624 -
This commit is contained in:
parent
f7794cff2a
commit
0f7ce1431b
@ -1538,6 +1538,7 @@ var
|
|||||||
LastAtomStart, LastAtomEnd: integer;
|
LastAtomStart, LastAtomEnd: integer;
|
||||||
StackIndex: LongInt;
|
StackIndex: LongInt;
|
||||||
PrevLineAtomEndPos: LongInt;
|
PrevLineAtomEndPos: LongInt;
|
||||||
|
InsertTextStartPos: Integer;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
FillByte(Indent,SizeOf(Indent),0);
|
FillByte(Indent,SizeOf(Indent),0);
|
||||||
@ -1587,7 +1588,11 @@ begin
|
|||||||
StackIndex:=FindStackPosForBlockCloseAtPos(Source,CleanPos,
|
StackIndex:=FindStackPosForBlockCloseAtPos(Source,CleanPos,
|
||||||
NewNestedComments,Stack,SubType,SubTypeValid);
|
NewNestedComments,Stack,SubType,SubTypeValid);
|
||||||
end else begin
|
end else begin
|
||||||
StackIndex:=FindStackPosForBlockCloseAtPos(InsertText,1,
|
InsertTextStartPos:=1;
|
||||||
|
while (InsertTextStartPos<=length(InsertText))
|
||||||
|
and (InsertText[InsertTextStartPos] in [' ',#9]) do
|
||||||
|
inc(InsertTextStartPos);
|
||||||
|
StackIndex:=FindStackPosForBlockCloseAtPos(InsertText,InsertTextStartPos,
|
||||||
NewNestedComments,Stack,SubType,SubTypeValid);
|
NewNestedComments,Stack,SubType,SubTypeValid);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user