diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-10-05 07:27:21 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-10-05 07:27:21 -0400 |
commit | 942aa9214ae053c2e682406dcb9b22f8f83ff97f (patch) | |
tree | 3ce0d774563f484621a423899b476a3225ad709b /common/modules/messages.jsm | |
parent | e498c0662a4b3cef2b478ef9edc8584d6bf911dd (diff) | |
download | pentadactyl-942aa9214ae053c2e682406dcb9b22f8f83ff97f.tar.gz |
Make caret visible while selected when in Visual Text Edit mode.
Diffstat (limited to 'common/modules/messages.jsm')
-rw-r--r-- | common/modules/messages.jsm | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/common/modules/messages.jsm b/common/modules/messages.jsm index a3267f2a..a6b22743 100644 --- a/common/modules/messages.jsm +++ b/common/modules/messages.jsm @@ -99,8 +99,8 @@ var Messages = Module("messages", { let { Buffer, commands, hints, io, mappings, modes, options, sanitizer } = overlay.activeModules; file = io.File(file); - function foo(base, iter_, prop) iter(function _foo() { - function key() [base, obj.identifier || obj.name].concat(Array.slice(arguments)).join(".").replace(/[:=]/g, "\\$&"); + function properties(base, iter_, prop) iter(function _properties() { + function key() [base, obj.identifier || obj.name].concat(Array.slice(arguments)).join(".").replace(/[\\:=]/g, "\\$&"); prop = prop || "description"; for (var obj in iter_) { @@ -121,14 +121,15 @@ var Messages = Module("messages", { }()).toArray(); file.write( - array(commands.allHives.map(function (h) foo("command", h))) - .concat(modes.all.map(function (m) foo("map", values(mappings.builtin.getStack(m) - .filter(function (map) map.modes[0] == m))))) - .concat(foo("mode", values(modes.all.filter(function (m) !m.hidden)))) - .concat(foo("option", options)) - .concat(foo("hintmode", values(hints.modes), "prompt")) - .concat(foo("pageinfo", values(Buffer.pageInfo), "title")) - .concat(foo("sanitizeitem", values(sanitizer.itemMap))) + array(commands.allHives.map(function (h) properties("command", h))) + .concat(modes.all.map(function (m) + properties("map", values(mappings.builtin.getStack(m) + .filter(function (map) map.modes[0] == m))))) + .concat(properties("mode", values(modes.all.filter(function (m) !m.hidden)))) + .concat(properties("option", options)) + .concat(properties("hintmode", values(hints.modes), "prompt")) + .concat(properties("pageinfo", values(Buffer.pageInfo), "title")) + .concat(properties("sanitizeitem", values(sanitizer.itemMap))) .flatten().uniq().join("\n")); } }, { @@ -154,7 +155,10 @@ var Messages = Module("messages", { function getter(key, default_) function getter() messages.get([name, key].join("."), default_); if (value != null) { - var name = [this.constructor.className.toLowerCase(), this.identifier || this.name, prop].join("."); + var name = [this.constructor.className.toLowerCase(), + this.identifier || this.name, + prop].join("."); + if (!isObject(value)) value = messages.get(name, value); else if (isArray(value)) |