diff options
author | Kris Maglione <maglione.k@gmail.com> | 2008-12-04 10:25:13 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2008-12-04 10:25:13 -0500 |
commit | 5791543e89771225d4910b644fdfbce9bfb9f46a (patch) | |
tree | 6fd2e42cc2bbcfa15a44082d519a61d84bebf055 /common/content/ui.js | |
parent | 6ae1fa663e41179e4453af390ffb1489326816ff (diff) | |
download | pentadactyl-5791543e89771225d4910b644fdfbce9bfb9f46a.tar.gz |
Fix <Tab> with async completions
Diffstat (limited to 'common/content/ui.js')
-rw-r--r-- | common/content/ui.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/common/content/ui.js b/common/content/ui.js index 68f9fc0a..a0328332 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -101,7 +101,7 @@ function CommandLine() //{{{ let self = this; context.onUpdate = function () { - self.reset(); + self.reset(true); }; this.context = context; this.editor = context.editor; @@ -159,7 +159,7 @@ function CommandLine() //{{{ full: this.wildmode.checkHas(this.wildtype, "full") }), - complete: function (show, tabPressed) + complete: function complete(show, tabPressed) { this.context.reset(); this.context.tabPressed = tabPressed; @@ -169,9 +169,9 @@ function CommandLine() //{{{ preview: function preview() { - if (this.wildtype < 0 || this.suffix || !this.items.length) - return; this.previewClear(); + if (this.wildIndex < 0 || this.suffix || !this.items.length) + return; let substring = ""; switch (this.wildtype.replace(/.*:/, "")) @@ -946,8 +946,6 @@ function CommandLine() //{{{ onEvent: function onEvent(event) { - if (completions) - completions.previewClear(); let command = this.getCommand(); if (event.type == "blur") @@ -973,10 +971,14 @@ function CommandLine() //{{{ } else if (event.type == "input") { + if (completions) + completions.previewClear(); liberator.triggerCallback("change", currentExtendedMode, command); } else if (event.type == "keypress") { + if (completions) + completions.previewClear(); if (!currentExtendedMode) return true; |