mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 16:19:36 +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;
|
||||
begin
|
||||
Result:=false;
|
||||
if Identifier='' then exit;;
|
||||
if Identifier='' then exit;
|
||||
p:=PChar(Identifier);
|
||||
repeat
|
||||
if not IsIdentStartChar[p^] then exit;
|
||||
|
@ -5562,7 +5562,7 @@ begin
|
||||
Result:=mrCancel;
|
||||
exit;
|
||||
end;
|
||||
if not IsValidIdent(NewUnitName) then begin
|
||||
if not IsDottedIdentifier(NewUnitName) then begin
|
||||
AlternativeUnitName:=NameToValidIdentifier(NewUnitName);
|
||||
Result:=IDEMessageDialogAb(lisInvalidPascalIdentifierCap,
|
||||
Format(lisInvalidPascalIdentifierText,[NewUnitName,AlternativeUnitName]),
|
||||
|
@ -52,7 +52,7 @@ uses
|
||||
FileUtil, Controls, Dialogs, InterfaceBase, maps,
|
||||
// codetools
|
||||
Laz_XMLCfg, CodeToolsConfig, ExprEval, FileProcs, DefineTemplates,
|
||||
CodeToolsCfgScript, CodeToolManager, CodeCache,
|
||||
BasicCodeTools, CodeToolsCfgScript, CodeToolManager, CodeCache,
|
||||
// IDEIntf
|
||||
PropEdits, CompOptsIntf, ProjectIntf, MacroIntf, LazIDEIntf,
|
||||
// IDE
|
||||
@ -4004,12 +4004,16 @@ end;
|
||||
function TProject.IndexOfUnitWithName(const AnUnitName:string;
|
||||
OnlyProjectUnits:boolean; IgnoreUnit: TUnitInfo):integer;
|
||||
begin
|
||||
if AnUnitName='' then exit(-1);
|
||||
Result:=UnitCount-1;
|
||||
while (Result>=0) do begin
|
||||
if ((OnlyProjectUnits and Units[Result].IsPartOfProject)
|
||||
or (not OnlyProjectUnits))
|
||||
and (IgnoreUnit<>Units[Result]) then begin
|
||||
if (AnsiCompareText(Units[Result].Unit_Name,AnUnitName)=0) then
|
||||
and (IgnoreUnit<>Units[Result])
|
||||
and (Units[Result].Unit_Name<>'')
|
||||
then begin
|
||||
if (CompareDottedIdentifiers(PChar(Units[Result].Unit_Name),PChar(AnUnitName))=0)
|
||||
then
|
||||
exit;
|
||||
end;
|
||||
dec(Result);
|
||||
|
Loading…
Reference in New Issue
Block a user