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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user