mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 18:49:19 +02:00
codetools: code completion: if cursor in interface search nearest node in front and same line
git-svn-id: trunk@50003 -
This commit is contained in:
parent
1152bfdc38
commit
580b22f36e
@ -9145,11 +9145,13 @@ begin
|
|||||||
// test if forward proc
|
// test if forward proc
|
||||||
//debugln('TCodeCompletionCodeTool.CompleteCode ',CursorNode.DescAsString);
|
//debugln('TCodeCompletionCodeTool.CompleteCode ',CursorNode.DescAsString);
|
||||||
if CursorNode.Desc = ctnInterface then
|
if CursorNode.Desc = ctnInterface then
|
||||||
begin//Search nearest (to the left) CursorNode if we are within interface section
|
begin
|
||||||
|
//Search nearest (to the left) CursorNode if we are within interface section
|
||||||
CursorNode := CursorNode.LastChild;
|
CursorNode := CursorNode.LastChild;
|
||||||
while Assigned(CursorNode) and (CursorNode.StartPos > CleanCursorPos) do
|
while Assigned(CursorNode) and (CursorNode.StartPos > CleanCursorPos) do
|
||||||
CursorNode := CursorNode.PriorBrother;
|
CursorNode := CursorNode.PriorBrother;
|
||||||
if CursorNode=nil then
|
if (CursorNode=nil)
|
||||||
|
or (not PositionsInSameLine(Src,CursorNode.EndPos,CleanCursorPos)) then
|
||||||
CursorNode:=FCompletingCursorNode;
|
CursorNode:=FCompletingCursorNode;
|
||||||
end;
|
end;
|
||||||
ProcNode:=CursorNode.GetNodeOfType(ctnProcedure);
|
ProcNode:=CursorNode.GetNodeOfType(ctnProcedure);
|
||||||
|
Loading…
Reference in New Issue
Block a user