codetools: identifier completion: do not add semicolon twice

git-svn-id: trunk@15846 -
This commit is contained in:
mattias 2008-07-23 11:59:52 +00:00
parent e596ab63b2
commit e03b7c5869
2 changed files with 19 additions and 14 deletions

View File

@ -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)

View File

@ -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;