diff --git a/components/codetools/customcodetool.pas b/components/codetools/customcodetool.pas index 499cffc402..c1d2337d23 100644 --- a/components/codetools/customcodetool.pas +++ b/components/codetools/customcodetool.pas @@ -2403,7 +2403,7 @@ end; function TCustomCodeTool.StringIsKeyWord(const Word: string): boolean; begin Result:=(Word<>'') and IsIdentStartChar[Word[1]] - and WordIsKeyWordFuncList.DoItUpperCase(Word,1,length(Word)); + and WordIsKeyWordFuncList.DoItCaseInsensitive(Word); end; procedure TCustomCodeTool.MoveCursorToNodeStart(ANode: TCodeTreeNode); diff --git a/ide/findrenameidentifier.pas b/ide/findrenameidentifier.pas index f793ec53e6..83d6a08869 100644 --- a/ide/findrenameidentifier.pas +++ b/ide/findrenameidentifier.pas @@ -1064,17 +1064,18 @@ begin if IsNodeInvalid('TFindRenameIdentifierDialog.ValidateNewName') then exit; Err:=''; FNewIdentifier:=NewEdit.Text; - if (FNode<>nil) - and (FNode.Desc in [ctnProgram..ctnUnit,ctnUseUnitNamespace,ctnUseUnitClearName]) then - ok:=IsValidDottedIdent(FNewIdentifier) //can be dotted - else - ok:=IsValidDottedIdent(FNewIdentifier,false);//not dotted for sure - + ok:=IsValidDottedIdent(FNewIdentifier); if not ok then begin if FNewIdentifier='' then Err:=lisIdentifierCannotBeEmpty else Err:= format(lisIdentifierIsInvalid,[FNewIdentifier]); + end else if not (FNode.Desc in [ctnProgram..ctnUnit,ctnUseUnit, + ctnUseUnitNamespace,ctnUseUnitClearName]) + and (Pos('.',FNewIdentifier)>0) then + begin + ok:=false; + Err:=Format(lisIdentifierCannotBeDotted,[FNewIdentifier]); end; if ok and (FTool<>nil) then begin