mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 02:59:50 +02:00
codetools: FindStartOfAtom check if at start of string constant, bug #16203
git-svn-id: trunk@24446 -
This commit is contained in:
parent
fda361abd7
commit
314c61457e
@ -2034,16 +2034,22 @@ end;
|
||||
function FindStartOfAtom(const Source: string; Position: integer): integer;
|
||||
|
||||
procedure ReadStringConstantBackward(var p: integer);
|
||||
var PrePos: integer;
|
||||
var
|
||||
PrePos: integer;
|
||||
begin
|
||||
while (p>1) do begin
|
||||
case Source[p-1] of
|
||||
'''':
|
||||
begin
|
||||
dec(p);
|
||||
PrePos:=p;
|
||||
dec(PrePos);
|
||||
repeat
|
||||
dec(p);
|
||||
until (p<1) or (Source[p]='''');
|
||||
dec(PrePos);
|
||||
if (PrePos<1) or (Source[PrePos] in [#10,#13]) then begin
|
||||
exit;
|
||||
end;
|
||||
until (Source[PrePos]='''');
|
||||
p:=PrePos;
|
||||
end;
|
||||
'0'..'9','A'..'Z','a'..'z':
|
||||
begin
|
||||
@ -2086,6 +2092,7 @@ begin
|
||||
Result:=length(Source);
|
||||
exit;
|
||||
end;
|
||||
|
||||
c:=Source[Result];
|
||||
case c of
|
||||
'_','A'..'Z','a'..'z':
|
||||
|
@ -1567,6 +1567,7 @@ begin
|
||||
FillByte(Indent,SizeOf(Indent),0);
|
||||
|
||||
CleanPos:=FindStartOfAtom(Source,CleanPos);
|
||||
DebugLn(['TFullyAutomaticBeautifier.GetIndent ']);
|
||||
if CleanPos<1 then exit;
|
||||
|
||||
if UseLineStart and (InsertText='') then begin
|
||||
|
@ -517,7 +517,9 @@ begin
|
||||
inc(PreferredHeight, (Adjusted.Top - ARect.Top) + (ARect.Bottom - Adjusted.Bottom));
|
||||
{$ENDIF}
|
||||
|
||||
{$IFNDEF OldAutoSize}
|
||||
FixedWidth:=false;
|
||||
{$ENDIF}
|
||||
if [akLeft,akRight]*Anchors=[akLeft,akRight] then begin
|
||||
// the width depends on the parent or siblings
|
||||
// use a simpe heuristic to find out if the width is fixed
|
||||
@ -526,7 +528,9 @@ begin
|
||||
and (Parent.AutoSize=false)
|
||||
then begin
|
||||
// the width is fixed
|
||||
{$IFNDEF OldAutoSize}
|
||||
FixedWidth:=true;
|
||||
{$ENDIF}
|
||||
WrapButtons(Width, NewWidth, NewHeight, True);
|
||||
PreferredWidth := NewWidth;
|
||||
PreferredHeight := NewHeight;
|
||||
|
Loading…
Reference in New Issue
Block a user