mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 18:17:18 +02:00
codetools: identifier completion: do not add semicolon twice
git-svn-id: trunk@15846 -
This commit is contained in:
parent
e596ab63b2
commit
e03b7c5869
@ -1540,22 +1540,25 @@ begin
|
||||
// check if in statement
|
||||
if (ilcfStartInStatement in CurrentIdentifierList.ContextFlags) then
|
||||
begin
|
||||
if (CurrentIdentifierList.StartBracketLvl=0)
|
||||
and (not (ilcfStartIsLValue in CurrentIdentifierList.ContextFlags))
|
||||
// check if a semicolon is needed at the end
|
||||
if (CurrentIdentifierList.StartBracketLvl>0)
|
||||
or (CurPos.Flag in [cafSemicolon, cafEqual, cafColon, cafComma,
|
||||
cafPoint, cafRoundBracketOpen, cafRoundBracketClose,
|
||||
cafEdgedBracketOpen, cafEdgedBracketClose])
|
||||
or ((CurPos.Flag=cafWord)
|
||||
and (UpAtomIs('ELSE')
|
||||
or UpAtomIs('THEN')
|
||||
or UpAtomIs('DO')
|
||||
or UpAtomIs('TO')
|
||||
or UpAtomIs('OF')))
|
||||
then begin
|
||||
// do not add semicolon
|
||||
CurrentIdentifierList.ContextFlags:=
|
||||
CurrentIdentifierList.ContextFlags+[ilcfNoEndSemicolon];
|
||||
end
|
||||
else if (not (ilcfStartIsLValue in CurrentIdentifierList.ContextFlags))
|
||||
then begin
|
||||
// check if a semicolon is needed at the end
|
||||
if (CurPos.Flag=cafWord)
|
||||
and (UpAtomIs('ELSE')
|
||||
or UpAtomIs('THEN')
|
||||
or UpAtomIs('DO')
|
||||
or UpAtomIs('TO')
|
||||
or UpAtomIs('OF'))
|
||||
then begin
|
||||
// do not add semicolon
|
||||
CurrentIdentifierList.ContextFlags:=
|
||||
CurrentIdentifierList.ContextFlags+[ilcfNoEndSemicolon];
|
||||
end
|
||||
else
|
||||
if (CurPos.Flag in [cafEnd,cafBegin])
|
||||
or WordIsBlockKeyWord.DoItUpperCase(UpperSrc,
|
||||
CurPos.StartPos,CurPos.EndPos-CurPos.StartPos)
|
||||
|
@ -564,7 +564,9 @@ begin
|
||||
inherited AppInit(ScreenInfo);
|
||||
{$if defined(cpui386) or defined(cpux86_64)}
|
||||
// needed otherwise some gtk theme engines crash with division by zero
|
||||
{$IFNDEF DisableGtkDivZeroFix}
|
||||
SetExceptionMask(GetExceptionMask + [exZeroDivide]);
|
||||
{$ENDIF}
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user