mirror of
https://github.com/moparisthebest/Simba
synced 2025-02-07 02:30:19 -05:00
CodeCompletion Fix?
This commit is contained in:
parent
56da32fef0
commit
f4a443db05
@ -550,7 +550,7 @@ end;
|
|||||||
|
|
||||||
function TCodeInsight.GetExpressionAtPos(var BraceCount, BracketCount, CommaCount: Integer; out sp: Integer; IgnoreBrackets: Boolean): string;
|
function TCodeInsight.GetExpressionAtPos(var BraceCount, BracketCount, CommaCount: Integer; out sp: Integer; IgnoreBrackets: Boolean): string;
|
||||||
var
|
var
|
||||||
i, StartPos, EndPos: Integer;
|
i, StartPos, EndPos, Dif: Integer;
|
||||||
s: string;
|
s: string;
|
||||||
a: TDeclarationArray;
|
a: TDeclarationArray;
|
||||||
d: TDeclaration;
|
d: TDeclaration;
|
||||||
@ -575,12 +575,14 @@ begin
|
|||||||
EndPos := fPos - d.StartPos;
|
EndPos := fPos - d.StartPos;
|
||||||
s := d.CleanText;
|
s := d.CleanText;
|
||||||
|
|
||||||
|
Dif := EndPos;
|
||||||
for i := Low(a) to High(a) do
|
for i := Low(a) to High(a) do
|
||||||
if (fPos > a[i].EndPos) then
|
if (fPos > a[i].EndPos) then
|
||||||
if (Pos(LineEnding, a[i].RawText) > 0) then
|
if (Pos(LineEnding, a[i].RawText) > 0) then
|
||||||
EndPos := EndPos - a[i].EndPos + a[i].StartPos + Length(LineEnding)
|
EndPos := EndPos - a[i].EndPos + a[i].StartPos + Length(LineEnding)
|
||||||
else
|
else
|
||||||
EndPos := EndPos - a[i].EndPos + a[i].StartPos + 1;
|
EndPos := EndPos - a[i].EndPos + a[i].StartPos + 1;
|
||||||
|
Dif := Dif - EndPos;
|
||||||
|
|
||||||
StartPos := EndPos;
|
StartPos := EndPos;
|
||||||
LastWasDot := False;
|
LastWasDot := False;
|
||||||
@ -640,7 +642,7 @@ begin
|
|||||||
LastWasDot := False;
|
LastWasDot := False;
|
||||||
Dec(StartPos);
|
Dec(StartPos);
|
||||||
end;
|
end;
|
||||||
sp := StartPos + d.StartPos;
|
sp := StartPos + d.StartPos + Dif;
|
||||||
Result := CompressWhiteSpace(Copy(s, StartPos + 1, EndPos - StartPos));
|
Result := CompressWhiteSpace(Copy(s, StartPos + 1, EndPos - StartPos));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user