can now purge history items from history view

This commit is contained in:
sawka
2023-03-03 13:31:45 -08:00
parent fb432b3cda
commit 8a0d58e05d
+13
View File
@@ -1859,6 +1859,14 @@ class HistoryViewModel {
}
_deleteSelected() : void {
let lineIds = Array.from(this.selectedItems.keys());
let prtn = GlobalCommandRunner.historyPurgeLines(lineIds);
prtn.then((result : boolean) => {
if (!result) {
GlobalModel.showAlert({message: "Error removing history lines."});
return;
}
});
let offset = this.offset.get();
GlobalCommandRunner.historyView({offset: offset, searchText: this.activeSearchText});
}
@@ -3027,6 +3035,11 @@ class CommandRunner {
GlobalModel.submitCommand("history", null, null, kwargs, true);
}
historyPurgeLines(lines : string[]) : Promise<boolean> {
let prtn = GlobalModel.submitCommand("history", "purge", lines, {"nohist": "1"}, false);
return prtn;
}
switchSession(session : string) {
GlobalModel.submitCommand("session", null, [session], {"nohist": "1"}, false);
}