feat: persistent recent files history + fix limit enforcement + fix settings data loss
- Recent files are now persisted to disk and survive restarts - Max items limit is applied on load (in case setting was reduced) - Omitted paths regex filtering is now wired up in addToRecentFiles - Fixed saveAndRefresh() overwriting entire plugin data on settings change - Debounced disk writes (300ms) to avoid excessive saves on rapid opens
This commit is contained in:
@@ -304,7 +304,7 @@ export class WaypointView extends ItemView {
|
||||
removeBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
this.plugin.recentFiles = this.plugin.recentFiles.filter(f => f.path !== file.path);
|
||||
this.plugin.saveSettings();
|
||||
this.plugin.persistRecentFiles();
|
||||
this.redraw();
|
||||
});
|
||||
setTooltip(navFile, file.path);
|
||||
@@ -384,7 +384,7 @@ export class WaypointView extends ItemView {
|
||||
} else {
|
||||
new Notice('Cannot find file');
|
||||
this.plugin.recentFiles = this.plugin.recentFiles.filter(f => f.path !== file.path);
|
||||
this.plugin.saveSettings();
|
||||
this.plugin.persistRecentFiles();
|
||||
this.redraw();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user