mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 15:00:31 +02:00
codetools: fixed FindCOdeOrLineEndInFrontOf for bracket close, bug #16419
git-svn-id: trunk@25238 -
This commit is contained in:
parent
6b1168a249
commit
4809be32c6
@ -2464,8 +2464,12 @@ var SrcStart: integer;
|
||||
Result:=not (StopAtDirectives
|
||||
and (P>=SrcStart) and (Source[P+1]='$'));
|
||||
dec(P,2);
|
||||
end else
|
||||
Result:=true;
|
||||
end else begin
|
||||
// normal bracket
|
||||
// => position behind code
|
||||
inc(p);
|
||||
Result:=false;
|
||||
end;
|
||||
end;
|
||||
else
|
||||
Result:=true;
|
||||
@ -2477,6 +2481,7 @@ var
|
||||
TestPos: integer;
|
||||
LineStartPos: LongInt;
|
||||
IsEmpty: Boolean;
|
||||
LineEndPos: Integer;
|
||||
begin
|
||||
SrcStart:=MinPosition;
|
||||
if SrcStart<1 then SrcStart:=1;
|
||||
@ -2499,6 +2504,7 @@ begin
|
||||
if (Result>SrcStart) and (Source[Result-1] in [#10,#13])
|
||||
and (Source[Result]<>Source[Result-1]) then
|
||||
dec(Result);
|
||||
LineEndPos:=Result+1;
|
||||
// test if in a // comment
|
||||
LineStartPos:=Result;
|
||||
IsEmpty:=true;
|
||||
@ -2512,6 +2518,7 @@ begin
|
||||
end;
|
||||
if IsEmpty then begin
|
||||
// the line is empty
|
||||
Result:=LineEndPos;
|
||||
exit;
|
||||
end;
|
||||
TestPos:=LineStartPos;
|
||||
|
@ -4748,6 +4748,7 @@ begin
|
||||
// -> delete whole line
|
||||
FromPos:=FindLineEndOrCodeInFrontOfPosition(VarNode.StartPos);
|
||||
ToPos:=FindLineEndOrCodeAfterPosition(VarNode.EndPos);
|
||||
//debugln(['TStandardCodeTool.RemovePublishedVariable ',dbgstr(copy(Src,FromPos,ToPos-FromPos))]);
|
||||
end else begin
|
||||
// variable definition has the form 'VarName, NextVarName: VarType;'
|
||||
// -> delete only 'VarName, '
|
||||
|
Loading…
Reference in New Issue
Block a user