mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 02:19:37 +02:00
ide: create new unique unit name: check disk files
This commit is contained in:
parent
547f5dd88d
commit
435a011e8a
10
ide/main.pp
10
ide/main.pp
@ -6303,6 +6303,8 @@ function TMainIDE.CreateNewUniqueFilename(const Prefix, Ext: string;
|
|||||||
NewOwner: TObject; Flags: TSearchIDEFileFlags; TryWithoutNumber: boolean): string;
|
NewOwner: TObject; Flags: TSearchIDEFileFlags; TryWithoutNumber: boolean): string;
|
||||||
|
|
||||||
function FileIsUnique(const ShortFilename: string): boolean;
|
function FileIsUnique(const ShortFilename: string): boolean;
|
||||||
|
var
|
||||||
|
aUnitName, InFilename: String;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
|
||||||
@ -6324,6 +6326,14 @@ function TMainIDE.CreateNewUniqueFilename(const Prefix, Ext: string;
|
|||||||
if (siffCheckAllProjects in Flags) then begin
|
if (siffCheckAllProjects in Flags) then begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// search in project unit path
|
||||||
|
if FilenameIsPascalUnit(ShortFilename) then begin
|
||||||
|
aUnitName:=ExtractFileNameOnly(ShortFilename);
|
||||||
|
InFilename:='';
|
||||||
|
if CodeToolBoss.DirectoryCachePool.FindUnitSourceInCompletePath(Project1.Directory,
|
||||||
|
aUnitName,InFilename,true)<>'' then exit;
|
||||||
|
end;
|
||||||
|
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user