mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 07:36:14 +02:00
IDE: allow renaming units dotted
git-svn-id: trunk@34163 -
This commit is contained in:
parent
cebbdc9d4a
commit
947ce90ff5
@ -4207,7 +4207,7 @@ var
|
|||||||
p: PChar;
|
p: PChar;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if Identifier='' then exit;;
|
if Identifier='' then exit;
|
||||||
p:=PChar(Identifier);
|
p:=PChar(Identifier);
|
||||||
repeat
|
repeat
|
||||||
if not IsIdentStartChar[p^] then exit;
|
if not IsIdentStartChar[p^] then exit;
|
||||||
|
@ -5562,7 +5562,7 @@ begin
|
|||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if not IsValidIdent(NewUnitName) then begin
|
if not IsDottedIdentifier(NewUnitName) then begin
|
||||||
AlternativeUnitName:=NameToValidIdentifier(NewUnitName);
|
AlternativeUnitName:=NameToValidIdentifier(NewUnitName);
|
||||||
Result:=IDEMessageDialogAb(lisInvalidPascalIdentifierCap,
|
Result:=IDEMessageDialogAb(lisInvalidPascalIdentifierCap,
|
||||||
Format(lisInvalidPascalIdentifierText,[NewUnitName,AlternativeUnitName]),
|
Format(lisInvalidPascalIdentifierText,[NewUnitName,AlternativeUnitName]),
|
||||||
|
@ -52,7 +52,7 @@ uses
|
|||||||
FileUtil, Controls, Dialogs, InterfaceBase, maps,
|
FileUtil, Controls, Dialogs, InterfaceBase, maps,
|
||||||
// codetools
|
// codetools
|
||||||
Laz_XMLCfg, CodeToolsConfig, ExprEval, FileProcs, DefineTemplates,
|
Laz_XMLCfg, CodeToolsConfig, ExprEval, FileProcs, DefineTemplates,
|
||||||
CodeToolsCfgScript, CodeToolManager, CodeCache,
|
BasicCodeTools, CodeToolsCfgScript, CodeToolManager, CodeCache,
|
||||||
// IDEIntf
|
// IDEIntf
|
||||||
PropEdits, CompOptsIntf, ProjectIntf, MacroIntf, LazIDEIntf,
|
PropEdits, CompOptsIntf, ProjectIntf, MacroIntf, LazIDEIntf,
|
||||||
// IDE
|
// IDE
|
||||||
@ -4004,12 +4004,16 @@ end;
|
|||||||
function TProject.IndexOfUnitWithName(const AnUnitName:string;
|
function TProject.IndexOfUnitWithName(const AnUnitName:string;
|
||||||
OnlyProjectUnits:boolean; IgnoreUnit: TUnitInfo):integer;
|
OnlyProjectUnits:boolean; IgnoreUnit: TUnitInfo):integer;
|
||||||
begin
|
begin
|
||||||
|
if AnUnitName='' then exit(-1);
|
||||||
Result:=UnitCount-1;
|
Result:=UnitCount-1;
|
||||||
while (Result>=0) do begin
|
while (Result>=0) do begin
|
||||||
if ((OnlyProjectUnits and Units[Result].IsPartOfProject)
|
if ((OnlyProjectUnits and Units[Result].IsPartOfProject)
|
||||||
or (not OnlyProjectUnits))
|
or (not OnlyProjectUnits))
|
||||||
and (IgnoreUnit<>Units[Result]) then begin
|
and (IgnoreUnit<>Units[Result])
|
||||||
if (AnsiCompareText(Units[Result].Unit_Name,AnUnitName)=0) then
|
and (Units[Result].Unit_Name<>'')
|
||||||
|
then begin
|
||||||
|
if (CompareDottedIdentifiers(PChar(Units[Result].Unit_Name),PChar(AnUnitName))=0)
|
||||||
|
then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
dec(Result);
|
dec(Result);
|
||||||
|
Loading…
Reference in New Issue
Block a user