- Now nested ignore files could be parsed correctly.
- The unexpected deletion of hidden files in some cases has been corrected.
- Hidden file change is no longer reflected on the device which has made the change itself.
This commit is contained in:
vorotamoroz
2023-08-08 10:42:07 +01:00
parent 4cd12c85ed
commit 7b9724f713
3 changed files with 21 additions and 16 deletions
+9 -4
View File
@@ -2569,9 +2569,14 @@ Or if you are sure know what had been happened, we can unlock the database from
}
}
/**
* Check the file is ignored by the ignore files.
* @param file
* @returns true if the file should be ignored, false if the file should be processed.
*/
async isIgnoredByIgnoreFiles(file: string | TAbstractFile) {
if (!this.settings.useIgnoreFiles) {
return true;
return false;
}
const filepath = file instanceof TFile ? file.path : file as string;
if (this.ignoreFileCache.has(filepath)) {
@@ -2579,14 +2584,14 @@ Or if you are sure know what had been happened, we can unlock the database from
await this.readIgnoreFile(filepath);
}
if (!await isAcceptedAll(stripAllPrefixes(filepath as FilePathWithPrefix), this.ignoreFiles, (filename) => this.getIgnoreFile(filename))) {
return false;
return true;
}
return true;
return false;
}
async isTargetFile(file: string | TAbstractFile) {
const filepath = file instanceof TFile ? file.path : file as string;
if (this.settings.useIgnoreFiles && !await this.isIgnoredByIgnoreFiles(file)) {
if (this.settings.useIgnoreFiles && await this.isIgnoredByIgnoreFiles(file)) {
return false;
}
return this.localDatabase.isTargetFile(filepath);