mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 03:56:12 +02:00
codetools: fixed complete event assignment
This commit is contained in:
parent
d0a8be0821
commit
c8ff4ec3ee
@ -2044,15 +2044,9 @@ function TCodeCompletionCodeTool.CompleteEventAssignment(CleanCursorPos,
|
||||
// check for semicolon at end of statement
|
||||
MoveCursorToCleanPos(UserEventAtom.EndPos);
|
||||
ReadNextAtom;
|
||||
if CurPos.Flag = cafRoundBracketOpen then
|
||||
if Scanner.CompilerMode <> cmDELPHI then
|
||||
Exit // indeed it is assignment to function, e.g. x:=sin(y);
|
||||
else begin
|
||||
ReadNextAtom;
|
||||
if CurPos.Flag <> cafRoundBracketClose then
|
||||
Exit; // in Delhi mode empty brackets are allowed after method: OnClick:=FormCreate();
|
||||
ReadNextAtom;
|
||||
end;
|
||||
if CurPos.Flag = cafRoundBracketOpen then begin
|
||||
exit; // e.g. x:=sin(y); -> don't create an event
|
||||
end;
|
||||
if AtomIsChar(';') then
|
||||
SemicolonPos:=CurPos.StartPos
|
||||
else
|
||||
@ -2162,8 +2156,8 @@ function TCodeCompletionCodeTool.CompleteEventAssignment(CleanCursorPos,
|
||||
end;
|
||||
|
||||
RValue:=AnEventName+';';
|
||||
if (AddrOperatorPos>0)
|
||||
or (Scanner.CompilerMode in [cmDelphi,cmDELPHIUNICODE])
|
||||
if (AddrOperatorPos<1)
|
||||
and not (Scanner.CompilerMode in [cmDelphi,cmDELPHIUNICODE])
|
||||
then
|
||||
RValue:='@'+RValue;
|
||||
if (AddrOperatorPos>0) or (UserEventAtom.StartPos>0) then begin
|
||||
|
Loading…
Reference in New Issue
Block a user