mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 20:41:00 +01:00
IDE: find/rename identifier: ignore missing files
git-svn-id: trunk@27588 -
This commit is contained in:
parent
62165a2e64
commit
d7dc05a36a
@ -55,7 +55,8 @@ type
|
||||
lbfRevert,
|
||||
lbfCheckIfText,
|
||||
lbfQuiet,
|
||||
lbfCreateClearOnError
|
||||
lbfCreateClearOnError,
|
||||
lbfIgnoreMissing
|
||||
);
|
||||
TLoadBufferFlags = set of TLoadBufferFlag;
|
||||
|
||||
@ -189,6 +190,8 @@ begin
|
||||
ACodeBuffer:=nil;
|
||||
if not FilenameIsAbsolute(AFilename) then
|
||||
Flags:=Flags-[lbfUpdateFromDisk,lbfRevert];
|
||||
if lbfCreateClearOnError in Flags then
|
||||
Exclude(Flags,lbfIgnoreMissing);
|
||||
if [lbfUpdateFromDisk,lbfRevert]*Flags=[] then begin
|
||||
// can use cache
|
||||
ACodeBuffer:=CodeToolBoss.LoadFile(AFilename,false,false);
|
||||
@ -225,6 +228,12 @@ begin
|
||||
if ACodeBuffer<>nil then begin
|
||||
Result:=mrOk;
|
||||
end else begin
|
||||
// read error
|
||||
if lbfIgnoreMissing in Flags then begin
|
||||
if (FilenameIsAbsolute(AFilename) and not FileExistsCached(AFilename))
|
||||
then
|
||||
exit(mrIgnore);
|
||||
end;
|
||||
if lbfQuiet in Flags then
|
||||
Result:=mrCancel
|
||||
else begin
|
||||
|
||||
@ -178,7 +178,7 @@ begin
|
||||
for i:=0 to Files.Count-1 do begin
|
||||
//debugln(['GatherIdentifierReferences ',Files[i]]);
|
||||
LoadResult:=
|
||||
LoadCodeBuffer(Code,Files[i],[lbfCheckIfText,lbfUpdateFromDisk],true);
|
||||
LoadCodeBuffer(Code,Files[i],[lbfCheckIfText,lbfUpdateFromDisk,lbfIgnoreMissing],true);
|
||||
if LoadResult=mrAbort then begin
|
||||
debugln('GatherIdentifierReferences unable to load "',Files[i],'"');
|
||||
exit;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user