1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 07:57:59 +01:00

Add :private command.

This commit is contained in:
Kris Maglione
2013-04-26 19:36:45 -07:00
parent d021e48d3e
commit 4845c3d644
6 changed files with 49 additions and 3 deletions

View File

@@ -1002,12 +1002,18 @@ var CommandLine = Module("commandline", {
save: function save() {
if (events.feedingKeys)
return;
let str = this.input.value;
if (/^\s*$/.test(str))
return;
let privateData = this.checkPrivate(str);
if (privateData == "never-save")
return;
this.store = this.store.filter(function (line) (line.value || line) != str);
dactyl.trapErrors(function () {
this.store.push({ value: str, timestamp: Date.now()*1000, privateData: this.checkPrivate(str) });
this.store.push({ value: str, timestamp: Date.now()*1000, privateData: privateData });
}, this);
this.store = this.store.slice(Math.max(0, this.store.length - options["history"]));
},