1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-23 07:15:46 +01:00

Release 1.0 βeta 4.

This commit is contained in:
Kris Maglione
2010-12-30 22:59:12 -05:00
parent eb59a48d77
commit 2a218c2785
8 changed files with 18 additions and 16 deletions

View File

@@ -32,10 +32,8 @@ var Abbreviation = Class("Abbreviation", {
get modeChar() Abbreviation.modeChar(this.modes)
}, {
modeChar: function (_modes) {
let result = "";
for (let [, mode] in Iterator(_modes))
result += modes.getMode(mode).char;
if (/^(ic|ci)$/(result))
let result = array.uniq(_modes.map(function (m) m.char)).join("");
if (result == "ci")
result = "!";
return result;
}

View File

@@ -527,7 +527,6 @@ var Mappings = Module("mappings", {
return null;
}
function uniqueModes(modes) {
modes = modes.map(modules.modes.closure.getMode);
let chars = [k for ([k, v] in Iterator(modules.modes.modeChars))
if (v.every(function (mode) modes.indexOf(mode) >= 0))];
return array.uniq(modes.filter(function (m) chars.indexOf(m.char) < 0).concat(chars));

View File

@@ -228,10 +228,11 @@ var Modes = Module("modes", {
getStack: function (idx) this._modeStack[this._modeStack.length - idx - 1] || this._modeStack[0],
getCharModes: function (chr) [m for (m in values(this._modeMap)) if (m.char == chr)],
getCharModes: function (chr) (this.modeChars[chr] || []).slice(),
matchModes: function (obj)
[m for (m in values(this._modeMap)) if (Object.keys(obj).every(function (k) obj[k] == (m[k] || false)))],
this._modes.filter(function (mode) Object.keys(obj)
.every(function (k) obj[k] == (mode[k] || false))),
// show the current mode string in the command line
show: function show() {