From 09a3bfcaace0b48f8fe2e7afeb3ecbd1dbd7de50 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 5 Oct 2011 20:09:22 -0400 Subject: [PATCH] Add c_ help entries. --- common/content/commandline.js | 12 ++++++++---- common/content/dactyl.js | 3 +++ common/locale/en-US/cmdline.xml | 17 +++++++++++++++++ common/modules/completion.jsm | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/common/content/commandline.js b/common/content/commandline.js index 70c96201..ccb83125 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1609,28 +1609,32 @@ var CommandLine = Module("commandline", { self.completions.onTab(keypressEvents[0]); }); - bind(["", "", ""], "Select the next matching completion group", + bind(["", "", ""], + "Select the next matching completion group", function ({ keypressEvents, self }) { dactyl.assert(self.completions); self.completions.tabTimer.flush(); self.completions.select(self.completions.CTXT_DOWN); }); - bind(["", "", ""], "Select the previous matching completion group", + bind(["", "", ""], + "Select the previous matching completion group", function ({ keypressEvents, self }) { dactyl.assert(self.completions); self.completions.tabTimer.flush(); self.completions.select(self.completions.CTXT_UP); }); - bind(["", "", ""], "Select the next page of completions", + bind(["", "", ""], + "Select the next page of completions", function ({ keypressEvents, self }) { dactyl.assert(self.completions); self.completions.tabTimer.flush(); self.completions.select(self.completions.PAGE_DOWN); }); - bind(["", "", ""], "Select the previous page of completions", + bind(["", "", ""], + "Select the previous page of completions", function ({ keypressEvents, self }) { dactyl.assert(self.completions); self.completions.tabTimer.flush(); diff --git a/common/content/dactyl.js b/common/content/dactyl.js index f62a1110..4b64f2d7 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -695,6 +695,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { } else if (obj instanceof Map) { spec = function (map) obj.count ? <>count{map} : <>{map}; + tag = function (map) <>{ + let (c = obj.modes[0].char) c ? c + "_" : "" + }{ map }; link = function (map) { let [, mode, name, extra] = /^(?:(.)_)?(?:<([^>]+)>)?(.*)$/.exec(map); let k = {extra}; diff --git a/common/locale/en-US/cmdline.xml b/common/locale/en-US/cmdline.xml index 2e8ab21e..4b53f7bc 100644 --- a/common/locale/en-US/cmdline.xml +++ b/common/locale/en-US/cmdline.xml @@ -161,6 +161,23 @@ + + c_ c_]]> + <C-Tab> + +

Select the next matching completion group.

+
+
+ + + c_ c_]]> + <C-S-Tab> + +

Select the previous matching completion group.

+
+
+ +

Ex command lines

diff --git a/common/modules/completion.jsm b/common/modules/completion.jsm index 683eb641..f19f9406 100644 --- a/common/modules/completion.jsm +++ b/common/modules/completion.jsm @@ -643,7 +643,7 @@ var CompletionContext = Class("CompletionContext", { getRow: function getRow(idx, doc) { let cache = this.cache.rows; if (cache) { - if (!(idx in this.cache.rows)) + if (idx in this.items && !(idx in this.cache.rows)) try { cache[idx] = util.xmlToDom(this.createRow(this.items[idx]), doc || this.doc);