Add simple glob ignore patterns

This commit is contained in:
Andras Schmelczer 2025-05-22 21:41:59 +01:00
commit ceb217cda8
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
8 changed files with 95 additions and 8 deletions

View file

@ -253,6 +253,29 @@ export class SyncSettingsTab extends PluginSettingTab {
)
);
new Setting(containerEl)
.setName("Ignore patterns")
.setDesc(
"Patterns to ignore when syncing. Each line is a separate glob pattern. Patterns are matched against the relative path of the file. For example, to ignore all files in a folder named 'ignore', enter 'ignore/*'. To ignore all files with the extension '.log', enter '*.log'."
)
.addTextArea((text) =>
text
.setValue(
this.syncClient.getSettings().ignorePatterns.join("\n")
)
.setPlaceholder("Enter patterns to ignore, one per line")
.onChange(async (value) => {
const patterns = value
.split("\n")
.map((pattern) => pattern.trim())
.filter((pattern) => pattern.length > 0);
return this.syncClient.setSetting(
"ignorePatterns",
patterns
);
})
);
new Setting(containerEl)
.setName("Sync concurrency")
.setDesc(