1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 07:48:00 +01:00

Split Map.flags into individual properties of Map.

This commit is contained in:
Doug Kearns
2009-06-27 01:05:47 +10:00
parent 4afccff5e9
commit 6f2eb2d1ef
14 changed files with 139 additions and 124 deletions

View File

@@ -811,22 +811,22 @@ function History() //{{{
mappings.add(myModes, mappings.add(myModes,
["<C-o>"], "Go to an older position in the jump list", ["<C-o>"], "Go to an older position in the jump list",
function (count) { history.stepTo(-Math.max(count, 1)); }, function (count) { history.stepTo(-Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, mappings.add(myModes,
["<C-i>"], "Go to a newer position in the jump list", ["<C-i>"], "Go to a newer position in the jump list",
function (count) { history.stepTo(Math.max(count, 1)); }, function (count) { history.stepTo(Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, mappings.add(myModes,
["H", "<A-Left>", "<M-Left>"], "Go back in the browser history", ["H", "<A-Left>", "<M-Left>"], "Go back in the browser history",
function (count) { history.stepTo(-Math.max(count, 1)); }, function (count) { history.stepTo(-Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, mappings.add(myModes,
["L", "<A-Right>", "<M-Right>"], "Go forward in the browser history", ["L", "<A-Right>", "<M-Right>"], "Go forward in the browser history",
function (count) { history.stepTo(Math.max(count, 1)); }, function (count) { history.stepTo(Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS //////////////////////////////////////////////// ////////////////////// COMMANDS ////////////////////////////////////////////////
@@ -1064,7 +1064,7 @@ function QuickMarks() //{{{
mappings.add(myModes, mappings.add(myModes,
["go"], "Jump to a QuickMark", ["go"], "Jump to a QuickMark",
function (arg) { quickmarks.jumpTo(arg, liberator.CURRENT_TAB); }, function (arg) { quickmarks.jumpTo(arg, liberator.CURRENT_TAB); },
{ flags: Mappings.flags.ARGUMENT }); { arg: true });
mappings.add(myModes, mappings.add(myModes,
["gn"], "Jump to a QuickMark in a new tab", ["gn"], "Jump to a QuickMark in a new tab",
@@ -1074,7 +1074,7 @@ function QuickMarks() //{{{
/\bquickmark\b/.test(options["activate"]) ? /\bquickmark\b/.test(options["activate"]) ?
liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB); liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB);
}, },
{ flags: Mappings.flags.ARGUMENT }); { arg: true });
mappings.add(myModes, mappings.add(myModes,
["M"], "Add new QuickMark for current URL", ["M"], "Add new QuickMark for current URL",
@@ -1085,7 +1085,7 @@ function QuickMarks() //{{{
quickmarks.add(arg, buffer.URL); quickmarks.add(arg, buffer.URL);
}, },
{ flags: Mappings.flags.ARGUMENT }); { arg: true });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS //////////////////////////////////////////////// ////////////////////// COMMANDS ////////////////////////////////////////////////

View File

@@ -204,7 +204,7 @@ function Buffer() //{{{
mappings.repeat(); mappings.repeat();
} }
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["i", "<Insert>"], mappings.add(myModes, ["i", "<Insert>"],
"Start caret mode", "Start caret mode",
@@ -223,22 +223,22 @@ function Buffer() //{{{
mappings.add(myModes, ["j", "<Down>", "<C-e>"], mappings.add(myModes, ["j", "<Down>", "<C-e>"],
"Scroll document down", "Scroll document down",
function (count) { buffer.scrollLines(Math.max(count, 1)); }, function (count) { buffer.scrollLines(Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["k", "<Up>", "<C-y>"], mappings.add(myModes, ["k", "<Up>", "<C-y>"],
"Scroll document up", "Scroll document up",
function (count) { buffer.scrollLines(-Math.max(count, 1)); }, function (count) { buffer.scrollLines(-Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, liberator.has("mail") ? ["h"] : ["h", "<Left>"], mappings.add(myModes, liberator.has("mail") ? ["h"] : ["h", "<Left>"],
"Scroll document to the left", "Scroll document to the left",
function (count) { buffer.scrollColumns(-Math.max(count, 1)); }, function (count) { buffer.scrollColumns(-Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, liberator.has("mail") ? ["l"] : ["l", "<Right>"], mappings.add(myModes, liberator.has("mail") ? ["l"] : ["l", "<Right>"],
"Scroll document to the right", "Scroll document to the right",
function (count) { buffer.scrollColumns(Math.max(count, 1)); }, function (count) { buffer.scrollColumns(Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["0", "^"], mappings.add(myModes, ["0", "^"],
"Scroll to the absolute left of the document", "Scroll to the absolute left of the document",
@@ -251,12 +251,12 @@ function Buffer() //{{{
mappings.add(myModes, ["gg", "<Home>"], mappings.add(myModes, ["gg", "<Home>"],
"Go to the top of the document", "Go to the top of the document",
function (count) { buffer.scrollToPercentiles(buffer.scrollXPercent, Math.max(count, 0)); }, function (count) { buffer.scrollToPercentiles(buffer.scrollXPercent, Math.max(count, 0)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["G", "<End>"], mappings.add(myModes, ["G", "<End>"],
"Go to the end of the document", "Go to the end of the document",
function (count) { buffer.scrollToPercentiles(buffer.scrollXPercent, count >= 0 ? count : 100); }, function (count) { buffer.scrollToPercentiles(buffer.scrollXPercent, count >= 0 ? count : 100); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["%"], mappings.add(myModes, ["%"],
"Scroll to {count} percent of the document", "Scroll to {count} percent of the document",
@@ -267,7 +267,7 @@ function Buffer() //{{{
else else
liberator.beep(); liberator.beep();
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
function scrollByScrollSize(count, direction) function scrollByScrollSize(count, direction)
{ {
@@ -279,42 +279,42 @@ function Buffer() //{{{
mappings.add(myModes, ["<C-d>"], mappings.add(myModes, ["<C-d>"],
"Scroll window downwards in the buffer", "Scroll window downwards in the buffer",
function (count) { scrollByScrollSize(count, true); }, function (count) { scrollByScrollSize(count, true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<C-u>"], mappings.add(myModes, ["<C-u>"],
"Scroll window upwards in the buffer", "Scroll window upwards in the buffer",
function (count) { scrollByScrollSize(count, false); }, function (count) { scrollByScrollSize(count, false); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<C-b>", "<PageUp>", "<S-Space>"], mappings.add(myModes, ["<C-b>", "<PageUp>", "<S-Space>"],
"Scroll up a full page", "Scroll up a full page",
function (count) { buffer.scrollPages(-Math.max(count, 1)); }, function (count) { buffer.scrollPages(-Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<C-f>", "<PageDown>", "<Space>"], mappings.add(myModes, ["<C-f>", "<PageDown>", "<Space>"],
"Scroll down a full page", "Scroll down a full page",
function (count) { buffer.scrollPages(Math.max(count, 1)); }, function (count) { buffer.scrollPages(Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["]f"], mappings.add(myModes, ["]f"],
"Focus next frame", "Focus next frame",
function (count) { buffer.shiftFrameFocus(Math.max(count, 1), true); }, function (count) { buffer.shiftFrameFocus(Math.max(count, 1), true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["[f"], mappings.add(myModes, ["[f"],
"Focus previous frame", "Focus previous frame",
function (count) { buffer.shiftFrameFocus(Math.max(count, 1), false); }, function (count) { buffer.shiftFrameFocus(Math.max(count, 1), false); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["]]"], mappings.add(myModes, ["]]"],
"Follow the link labeled 'next' or '>' if it exists", "Follow the link labeled 'next' or '>' if it exists",
function (count) { buffer.followDocumentRelationship("next"); }, function (count) { buffer.followDocumentRelationship("next"); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["[["], mappings.add(myModes, ["[["],
"Follow the link labeled 'prev', 'previous' or '<' if it exists", "Follow the link labeled 'prev', 'previous' or '<' if it exists",
function (count) { buffer.followDocumentRelationship("previous"); }, function (count) { buffer.followDocumentRelationship("previous"); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["gf"], mappings.add(myModes, ["gf"],
"View source", "View source",
@@ -366,7 +366,7 @@ function Buffer() //{{{
liberator.beep(); liberator.beep();
} }
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["gP"], mappings.add(myModes, ["gP"],
"Open (put) a URL based on the current clipboard contents in a new buffer", "Open (put) a URL based on the current clipboard contents in a new buffer",
@@ -424,58 +424,58 @@ function Buffer() //{{{
mappings.add(myModes, ["zi", "+"], mappings.add(myModes, ["zi", "+"],
"Enlarge text zoom of current web page", "Enlarge text zoom of current web page",
function (count) { buffer.zoomIn(Math.max(count, 1), false); }, function (count) { buffer.zoomIn(Math.max(count, 1), false); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zm"], mappings.add(myModes, ["zm"],
"Enlarge text zoom of current web page by a larger amount", "Enlarge text zoom of current web page by a larger amount",
function (count) { buffer.zoomIn(Math.max(count, 1) * 3, false); }, function (count) { buffer.zoomIn(Math.max(count, 1) * 3, false); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zo", "-"], mappings.add(myModes, ["zo", "-"],
"Reduce text zoom of current web page", "Reduce text zoom of current web page",
function (count) { buffer.zoomOut(Math.max(count, 1), false); }, function (count) { buffer.zoomOut(Math.max(count, 1), false); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zr"], mappings.add(myModes, ["zr"],
"Reduce text zoom of current web page by a larger amount", "Reduce text zoom of current web page by a larger amount",
function (count) { buffer.zoomOut(Math.max(count, 1) * 3, false); }, function (count) { buffer.zoomOut(Math.max(count, 1) * 3, false); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zz"], mappings.add(myModes, ["zz"],
"Set text zoom value of current web page", "Set text zoom value of current web page",
function (count) { buffer.textZoom = count > 1 ? count : 100; }, function (count) { buffer.textZoom = count > 1 ? count : 100; },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zI"], mappings.add(myModes, ["zI"],
"Enlarge full zoom of current web page", "Enlarge full zoom of current web page",
function (count) { buffer.zoomIn(Math.max(count, 1), true); }, function (count) { buffer.zoomIn(Math.max(count, 1), true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zM"], mappings.add(myModes, ["zM"],
"Enlarge full zoom of current web page by a larger amount", "Enlarge full zoom of current web page by a larger amount",
function (count) { buffer.zoomIn(Math.max(count, 1) * 3, true); }, function (count) { buffer.zoomIn(Math.max(count, 1) * 3, true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zO"], mappings.add(myModes, ["zO"],
"Reduce full zoom of current web page", "Reduce full zoom of current web page",
function (count) { buffer.zoomOut(Math.max(count, 1), true); }, function (count) { buffer.zoomOut(Math.max(count, 1), true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zR"], mappings.add(myModes, ["zR"],
"Reduce full zoom of current web page by a larger amount", "Reduce full zoom of current web page by a larger amount",
function (count) { buffer.zoomOut(Math.max(count, 1) * 3, true); }, function (count) { buffer.zoomOut(Math.max(count, 1) * 3, true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["zZ"], mappings.add(myModes, ["zZ"],
"Set full zoom value of current web page", "Set full zoom value of current web page",
function (count) { buffer.fullZoom = count > 1 ? count : 100; }, function (count) { buffer.fullZoom = count > 1 ? count : 100; },
{ flags: Mappings.flags.COUNT }); { count: true });
// page info // page info
mappings.add(myModes, ["<C-g>"], mappings.add(myModes, ["<C-g>"],
"Print the current file name", "Print the current file name",
function (count) { buffer.showPageInfo(false); }, function (count) { buffer.showPageInfo(false); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["g<C-g>"], mappings.add(myModes, ["g<C-g>"],
"Print file information", "Print file information",
@@ -1732,12 +1732,12 @@ function Marks() //{{{
marks.add(arg); marks.add(arg);
}, },
{ flags: Mappings.flags.ARGUMENT }); { arg: true });
mappings.add(myModes, mappings.add(myModes,
["'", "`"], "Jump to the mark in the current buffer", ["'", "`"], "Jump to the mark in the current buffer",
function (arg) { marks.jumpTo(arg); }, function (arg) { marks.jumpTo(arg); },
{ flags: Mappings.flags.ARGUMENT }); { arg: true });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS //////////////////////////////////////////////// ////////////////////// COMMANDS ////////////////////////////////////////////////

View File

@@ -970,7 +970,7 @@ function Commands() //{{{
else else
liberator.echoerr("E30: No previous command line"); liberator.echoerr("E30: No previous command line");
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
}); });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}

View File

@@ -114,7 +114,7 @@ function Editor() //{{{
{ {
let extraInfo = {}; let extraInfo = {};
if (hasCount) if (hasCount)
extraInfo.flags = Mappings.flags.COUNT; extraInfo.count = true;
mappings.add([modes.CARET], keys, "", mappings.add([modes.CARET], keys, "",
function (count) function (count)
@@ -178,7 +178,7 @@ function Editor() //{{{
mappings.add([modes.TEXTAREA], [key], mappings.add([modes.TEXTAREA], [key],
"Motion command", "Motion command",
function (motion, count) { editor.executeCommandWithMotion(key, motion, count); }, function (motion, count) { editor.executeCommandWithMotion(key, motion, count); },
{ flags: Mappings.flags.MOTION | Mappings.flags.COUNT }); { count: true, motion: true });
} }
// For the record, some of this code I've just finished throwing // For the record, some of this code I've just finished throwing
@@ -350,7 +350,7 @@ function Editor() //{{{
mappings.add([modes.INSERT], mappings.add([modes.INSERT],
["<Space>", "<Return>"], "Expand insert mode abbreviation", ["<Space>", "<Return>"], "Expand insert mode abbreviation",
function () { editor.expandAbbreviation("i"); }, function () { editor.expandAbbreviation("i"); },
{ flags: Mappings.flags.ALLOW_EVENT_ROUTING }); { route: true });
mappings.add([modes.INSERT], mappings.add([modes.INSERT],
["<Tab>"], "Expand insert mode abbreviation", ["<Tab>"], "Expand insert mode abbreviation",
@@ -368,7 +368,7 @@ function Editor() //{{{
editor.executeCommand("cmd_undo", count); editor.executeCommand("cmd_undo", count);
liberator.mode = modes.TEXTAREA; liberator.mode = modes.TEXTAREA;
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.TEXTAREA], mappings.add([modes.TEXTAREA],
["<C-r>"], "Redo", ["<C-r>"], "Redo",
@@ -377,7 +377,7 @@ function Editor() //{{{
editor.executeCommand("cmd_redo", count); editor.executeCommand("cmd_redo", count);
liberator.mode = modes.TEXTAREA; liberator.mode = modes.TEXTAREA;
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.TEXTAREA], mappings.add([modes.TEXTAREA],
["D"], "Delete the characters under the cursor until the end of the line", ["D"], "Delete the characters under the cursor until the end of the line",
@@ -405,12 +405,12 @@ function Editor() //{{{
mappings.add([modes.TEXTAREA], mappings.add([modes.TEXTAREA],
["X"], "Delete character to the left", ["X"], "Delete character to the left",
function (count) { editor.executeCommand("cmd_deleteCharBackward", count); }, function (count) { editor.executeCommand("cmd_deleteCharBackward", count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.TEXTAREA], mappings.add([modes.TEXTAREA],
["x"], "Delete character to the right", ["x"], "Delete character to the right",
function (count) { editor.executeCommand("cmd_deleteCharForward", count); }, function (count) { editor.executeCommand("cmd_deleteCharForward", count); },
{ flags: Mappings.flags.COUNT }); { count: true });
// visual mode // visual mode
mappings.add([modes.CARET, modes.TEXTAREA], mappings.add([modes.CARET, modes.TEXTAREA],
@@ -499,7 +499,7 @@ function Editor() //{{{
if (pos >= 0) if (pos >= 0)
editor.moveToPosition(pos, true, liberator.mode == modes.VISUAL); editor.moveToPosition(pos, true, liberator.mode == modes.VISUAL);
}, },
{ flags: Mappings.flags.ARGUMENT | Mappings.flags.COUNT }); { arg: true, count: true });
mappings.add([modes.TEXTAREA, modes.VISUAL], mappings.add([modes.TEXTAREA, modes.VISUAL],
["F"], "Move to a charater on the current line before the cursor", ["F"], "Move to a charater on the current line before the cursor",
@@ -509,7 +509,7 @@ function Editor() //{{{
if (pos >= 0) if (pos >= 0)
editor.moveToPosition(pos, false, liberator.mode == modes.VISUAL); editor.moveToPosition(pos, false, liberator.mode == modes.VISUAL);
}, },
{ flags: Mappings.flags.ARGUMENT | Mappings.flags.COUNT }); { arg: true, count: true });
mappings.add([modes.TEXTAREA, modes.VISUAL], mappings.add([modes.TEXTAREA, modes.VISUAL],
["t"], "Move before a character on the current line", ["t"], "Move before a character on the current line",
@@ -519,7 +519,7 @@ function Editor() //{{{
if (pos >= 0) if (pos >= 0)
editor.moveToPosition(pos - 1, true, liberator.mode == modes.VISUAL); editor.moveToPosition(pos - 1, true, liberator.mode == modes.VISUAL);
}, },
{ flags: Mappings.flags.ARGUMENT | Mappings.flags.COUNT }); { arg: true, count: true });
mappings.add([modes.TEXTAREA, modes.VISUAL], mappings.add([modes.TEXTAREA, modes.VISUAL],
["T"], "Move before a character on the current line, backwards", ["T"], "Move before a character on the current line, backwards",
@@ -529,7 +529,7 @@ function Editor() //{{{
if (pos >= 0) if (pos >= 0)
editor.moveToPosition(pos + 1, false, liberator.mode == modes.VISUAL); editor.moveToPosition(pos + 1, false, liberator.mode == modes.VISUAL);
}, },
{ flags: Mappings.flags.ARGUMENT | Mappings.flags.COUNT }); { arg: true, count: true });
// textarea and visual mode // textarea and visual mode
mappings.add([modes.TEXTAREA, modes.VISUAL], mappings.add([modes.TEXTAREA, modes.VISUAL],
@@ -555,7 +555,7 @@ function Editor() //{{{
} }
modes.set(modes.TEXTAREA); modes.set(modes.TEXTAREA);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS //////////////////////////////////////////////// ////////////////////// COMMANDS ////////////////////////////////////////////////

View File

@@ -639,7 +639,7 @@ function Events() //{{{
mappings.add([modes.NORMAL, modes.PLAYER, modes.MESSAGE], mappings.add([modes.NORMAL, modes.PLAYER, modes.MESSAGE],
["q"], "Record a key sequence into a macro", ["q"], "Record a key sequence into a macro",
function (arg) { events.startRecording(arg); }, function (arg) { events.startRecording(arg); },
{ flags: Mappings.flags.ARGUMENT }); { arg: true });
mappings.add([modes.NORMAL, modes.PLAYER, modes.MESSAGE], mappings.add([modes.NORMAL, modes.PLAYER, modes.MESSAGE],
["@"], "Play a macro", ["@"], "Play a macro",
@@ -649,7 +649,7 @@ function Events() //{{{
while (count-- && events.playMacro(arg)) while (count-- && events.playMacro(arg))
; ;
}, },
{ flags: Mappings.flags.ARGUMENT | Mappings.flags.COUNT }); { arg: true, count: true });
}); });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
@@ -1548,7 +1548,7 @@ function Events() //{{{
{ {
map = input.pendingMap; map = input.pendingMap;
input.pendingMap = null; input.pendingMap = null;
if (map && map.flags & Mappings.flags.ARGUMENT) if (map && map.arg)
input.pendingArgMap = map; input.pendingArgMap = map;
} }
@@ -1583,7 +1583,7 @@ function Events() //{{{
if (isNaN(input.count)) if (isNaN(input.count))
input.count = -1; input.count = -1;
input.buffer = ""; input.buffer = "";
if (map.flags & Mappings.flags.ARGUMENT) if (map.arg)
{ {
input.buffer = inputStr; input.buffer = inputStr;
input.pendingArgMap = map; input.pendingArgMap = map;
@@ -1595,7 +1595,7 @@ function Events() //{{{
input.pendingMotionMap = null; input.pendingMotionMap = null;
} }
// no count support for these commands yet // no count support for these commands yet
else if (map.flags & Mappings.flags.MOTION) else if (map.motion)
{ {
input.pendingMotionMap = map; input.pendingMotionMap = map;
} }
@@ -1605,7 +1605,7 @@ function Events() //{{{
return void killEvent(); return void killEvent();
let ret = map.execute(null, input.count); let ret = map.execute(null, input.count);
if (map.flags & Mappings.flags.ALLOW_EVENT_ROUTING && ret) if (map.route && ret)
stop = false; stop = false;
} }
} }

View File

@@ -879,7 +879,7 @@ function Hints() //{{{
onChange: function () { modes.pop(); }, onChange: function () { modes.pop(); },
onCancel: function (arg) { arg && setTimeout(function () hints.show(arg), 0); } onCancel: function (arg) { arg && setTimeout(function () hints.show(arg), 0); }
}); });
}, { flags: Mappings.flags.COUNT }); }, { count: true });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
////////////////////// PUBLIC SECTION ////////////////////////////////////////// ////////////////////// PUBLIC SECTION //////////////////////////////////////////

View File

@@ -59,18 +59,30 @@ function Map(modes, keys, description, action, extraInfo) //{{{
this.names = keys.map(events.canonicalKeys); this.names = keys.map(events.canonicalKeys);
/** @property {function (number)} The function called to execute this mapping. */ /** @property {function (number)} The function called to execute this mapping. */
this.action = action; this.action = action;
/** @property {number} @see Mappings#flags */
// FIXME: flags is incongruent with the other properties
this.flags = extraInfo.flags || 0;
/** @property {string} This mapping's description, as shown in :viusage. */ /** @property {string} This mapping's description, as shown in :viusage. */
this.description = description || ""; this.description = description || "";
/** @property {string} The literal RHS expansion of this mapping. */
this.rhs = extraInfo.rhs || null; /** @property {boolean} Whether this mapping accepts an argument. */
this.arg = extraInfo.arg || false;
/** @property {boolean} Whether this mapping accepts a count. */
this.count = extraInfo.count || false;
/**
* @property {boolean} Whether the mapping accepts a motion mapping
* as an argument.
*/
this.motion = extraInfo.motion || false;
/**
* @property {boolean} Whether the mapping's key events should be
* propagated to the host application.
*/
// TODO: I'm not sure this is the best name but it reflects that which it replaced. --djk
this.route = extraInfo.route || false;
/** @property {boolean} Whether the RHS of the mapping should expand mappings recursively. */ /** @property {boolean} Whether the RHS of the mapping should expand mappings recursively. */
this.noremap = extraInfo.noremap || false; this.noremap = extraInfo.noremap || false;
/** @property {boolean} Whether any output from the mapping should be echoed on the command line. */ /** @property {boolean} Whether any output from the mapping should be echoed on the command line. */
this.silent = extraInfo.silent || false; this.silent = extraInfo.silent || false;
/** @property {string} The literal RHS expansion of this mapping. */
this.rhs = extraInfo.rhs || null;
} }
Map.prototype = { Map.prototype = {
@@ -98,11 +110,11 @@ Map.prototype = {
{ {
let args = []; let args = [];
if (this.flags & Mappings.flags.MOTION) if (this.motion)
args.push(motion); args.push(motion);
if (this.flags & Mappings.flags.COUNT) if (this.count)
args.push(count); args.push(count);
if (this.flags & Mappings.flags.ARGUMENT) if (this.arg)
args.push(argument); args.push(argument);
let self = this; let self = this;
@@ -213,7 +225,7 @@ function Mappings() //{{{
"User defined mapping", "User defined mapping",
function (count) { events.feedkeys((count > -1 ? count : "") + this.rhs, this.noremap, this.silent); }, function (count) { events.feedkeys((count > -1 ? count : "") + this.rhs, this.noremap, this.silent); },
{ {
flags: Mappings.flags.COUNT, count: true,
rhs: events.canonicalKeys(rhs), rhs: events.canonicalKeys(rhs),
noremap: !!noremap, noremap: !!noremap,
silent: "<silent>" in args silent: "<silent>" in args
@@ -334,14 +346,6 @@ function Mappings() //{{{
]); ]);
}); });
// FIXME:
Mappings.flags = {
ALLOW_EVENT_ROUTING: 1 << 0, // if set, return true inside the map command to pass the event further to Firefox
MOTION: 1 << 1,
COUNT: 1 << 2,
ARGUMENT: 1 << 3
};
return { return {
// NOTE: just normal mode for now // NOTE: just normal mode for now

View File

@@ -233,17 +233,17 @@ function Tabs() //{{{
else else
tabs.select("+1", true); tabs.select("+1", true);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["<C-n>", "<C-Tab>", "<C-PageDown>"], mappings.add([modes.NORMAL], ["<C-n>", "<C-Tab>", "<C-PageDown>"],
"Go to the next tab", "Go to the next tab",
function (count) { tabs.select("+" + (count < 1 ? 1 : count), true); }, function (count) { tabs.select("+" + (count < 1 ? 1 : count), true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["gT", "<C-p>", "<C-S-Tab>", "<C-PageUp>"], mappings.add([modes.NORMAL], ["gT", "<C-p>", "<C-S-Tab>", "<C-PageUp>"],
"Go to previous tab", "Go to previous tab",
function (count) { tabs.select("-" + (count < 1 ? 1 : count), true); }, function (count) { tabs.select("-" + (count < 1 ? 1 : count), true); },
{ flags: Mappings.flags.COUNT }); { count: true });
if (config.hasTabbrowser) if (config.hasTabbrowser)
{ {
@@ -256,7 +256,7 @@ function Tabs() //{{{
else else
commandline.open(":", "buffer! ", modes.EX); commandline.open(":", "buffer! ", modes.EX);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["B"], mappings.add([modes.NORMAL], ["B"],
"Show buffer list", "Show buffer list",
@@ -265,22 +265,22 @@ function Tabs() //{{{
mappings.add([modes.NORMAL], ["d"], mappings.add([modes.NORMAL], ["d"],
"Delete current buffer", "Delete current buffer",
function (count) { tabs.remove(tabs.getTab(), count, false, 0); }, function (count) { tabs.remove(tabs.getTab(), count, false, 0); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["D"], mappings.add([modes.NORMAL], ["D"],
"Delete current buffer, focus tab to the left", "Delete current buffer, focus tab to the left",
function (count) { tabs.remove(tabs.getTab(), count, true, 0); }, function (count) { tabs.remove(tabs.getTab(), count, true, 0); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["gb"], mappings.add([modes.NORMAL], ["gb"],
"Repeat last :buffer[!] command", "Repeat last :buffer[!] command",
function (count) { tabs.switchTo(null, null, count, false); }, function (count) { tabs.switchTo(null, null, count, false); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["gB"], mappings.add([modes.NORMAL], ["gB"],
"Repeat last :buffer[!] command in reverse direction", "Repeat last :buffer[!] command in reverse direction",
function (count) { tabs.switchTo(null, null, count, true); }, function (count) { tabs.switchTo(null, null, count, true); },
{ flags: Mappings.flags.COUNT }); { count: true });
// TODO: feature dependencies - implies "session"? // TODO: feature dependencies - implies "session"?
if (liberator.has("tabUndo")) if (liberator.has("tabUndo"))
@@ -288,7 +288,7 @@ function Tabs() //{{{
mappings.add([modes.NORMAL], ["u"], mappings.add([modes.NORMAL], ["u"],
"Undo closing of a tab", "Undo closing of a tab",
function (count) { commands.get("undo").execute("", false, count); }, function (count) { commands.get("undo").execute("", false, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
} }
mappings.add([modes.NORMAL], ["<C-^>", "<C-6>"], mappings.add([modes.NORMAL], ["<C-^>", "<C-6>"],
@@ -300,7 +300,7 @@ function Tabs() //{{{
else else
tabs.switchTo(count.toString(), false); tabs.switchTo(count.toString(), false);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
} }
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}

View File

@@ -911,7 +911,7 @@ function CommandLine() //{{{
commandline.resetCompletions(); commandline.resetCompletions();
return editor.expandAbbreviation("c"); return editor.expandAbbreviation("c");
}, },
{ flags: Mappings.flags.ALLOW_EVENT_ROUTING }); { route: true });
mappings.add(myModes, mappings.add(myModes,
["<C-]>", "<C-5>"], "Expand command line abbreviation", ["<C-]>", "<C-5>"], "Expand command line abbreviation",

View File

@@ -273,7 +273,7 @@ function Mail() //{{{
mappings.add(myModes, ["<Space>"], mappings.add(myModes, ["<Space>"],
"Scroll message or select next unread one", "Scroll message or select next unread one",
function () true, function () true,
{ flags: Mappings.flags.ALLOW_EVENT_ROUTING }); { route: true });
mappings.add(myModes, ["t"], mappings.add(myModes, ["t"],
"Select thread", "Select thread",
@@ -286,32 +286,32 @@ function Mail() //{{{
mappings.add(myModes, ["j", "<Right>"], mappings.add(myModes, ["j", "<Right>"],
"Select next message", "Select next message",
function (count) { mail.selectMessage(function (msg) true, false, false, false, count); }, function (count) { mail.selectMessage(function (msg) true, false, false, false, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["gj"], mappings.add(myModes, ["gj"],
"Select next message, including closed threads", "Select next message, including closed threads",
function (count) { mail.selectMessage(function (msg) true, false, true, false, count); }, function (count) { mail.selectMessage(function (msg) true, false, true, false, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["J", "<Tab>"], mappings.add(myModes, ["J", "<Tab>"],
"Select next unread message", "Select next unread message",
function (count) { mail.selectMessage(function (msg) !msg.isRead, true, true, false, count); }, function (count) { mail.selectMessage(function (msg) !msg.isRead, true, true, false, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["k", "<Left>"], mappings.add(myModes, ["k", "<Left>"],
"Select previous message", "Select previous message",
function (count) { mail.selectMessage(function (msg) true, false, false, true, count); }, function (count) { mail.selectMessage(function (msg) true, false, false, true, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["gk"], mappings.add(myModes, ["gk"],
"Select previous message", "Select previous message",
function (count) { mail.selectMessage(function (msg) true, false, true, true, count); }, function (count) { mail.selectMessage(function (msg) true, false, true, true, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["K"], mappings.add(myModes, ["K"],
"Select previous unread message", "Select previous unread message",
function (count) { mail.selectMessage(function (msg) !msg.isRead, true, true, true, count); }, function (count) { mail.selectMessage(function (msg) !msg.isRead, true, true, true, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["*"], mappings.add(myModes, ["*"],
"Select next message from the same sender", "Select next message from the same sender",
@@ -324,7 +324,7 @@ function Mail() //{{{
} }
catch (e) { liberator.beep(); } catch (e) { liberator.beep(); }
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["#"], mappings.add(myModes, ["#"],
"Select previous message from the same sender", "Select previous message from the same sender",
@@ -337,7 +337,7 @@ function Mail() //{{{
} }
catch (e) { liberator.beep(); } catch (e) { liberator.beep(); }
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
// SENDING MESSAGES // SENDING MESSAGES
mappings.add(myModes, ["m"], mappings.add(myModes, ["m"],
@@ -379,22 +379,22 @@ function Mail() //{{{
mappings.add(myModes, ["<Down>"], mappings.add(myModes, ["<Down>"],
"Scroll message down", "Scroll message down",
function (count) { buffer.scrollLines(Math.max(count, 1)); }, function (count) { buffer.scrollLines(Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<Up>"], mappings.add(myModes, ["<Up>"],
"Scroll message up", "Scroll message up",
function (count) { buffer.scrollLines(-Math.max(count, 1)); }, function (count) { buffer.scrollLines(-Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.MESSAGE], ["<Left>"], mappings.add([modes.MESSAGE], ["<Left>"],
"Select previous message", "Select previous message",
function (count) { mail.selectMessage(function (msg) true, false, false, true, count); }, function (count) { mail.selectMessage(function (msg) true, false, false, true, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.MESSAGE], ["<Right>"], mappings.add([modes.MESSAGE], ["<Right>"],
"Select next message", "Select next message",
function (count) { mail.selectMessage(function (msg) true, false, false, false, count); }, function (count) { mail.selectMessage(function (msg) true, false, false, false, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
// UNDO/REDO // UNDO/REDO
mappings.add(myModes, ["u"], mappings.add(myModes, ["u"],
@@ -445,22 +445,22 @@ function Mail() //{{{
mappings.add(myModes, ["]s"], mappings.add(myModes, ["]s"],
"Select next starred message", "Select next starred message",
function (count) { mail.selectMessage(function (msg) msg.isFlagged, true, true, false, count); }, function (count) { mail.selectMessage(function (msg) msg.isFlagged, true, true, false, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["[s"], mappings.add(myModes, ["[s"],
"Select previous starred message", "Select previous starred message",
function (count) { mail.selectMessage(function (msg) msg.isFlagged, true, true, true, count); }, function (count) { mail.selectMessage(function (msg) msg.isFlagged, true, true, true, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["]a"], mappings.add(myModes, ["]a"],
"Select next message with an attachment", "Select next message with an attachment",
function (count) { mail.selectMessage(function (msg) gDBView.db.HasAttachments(msg.messageKey), true, true, false, count); }, function (count) { mail.selectMessage(function (msg) gDBView.db.HasAttachments(msg.messageKey), true, true, false, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["[a"], mappings.add(myModes, ["[a"],
"Select previous message with an attachment", "Select previous message with an attachment",
function (count) { mail.selectMessage(function (msg) gDBView.db.HasAttachments(msg.messageKey), true, true, true, count); }, function (count) { mail.selectMessage(function (msg) gDBView.db.HasAttachments(msg.messageKey), true, true, true, count); },
{ flags: Mappings.flags.COUNT }); { count: true });
// FOLDER SWITCHING // FOLDER SWITCHING
mappings.add(myModes, ["gi"], mappings.add(myModes, ["gi"],
@@ -473,7 +473,7 @@ function Mail() //{{{
else else
liberator.beep(); liberator.beep();
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<C-n>"], mappings.add(myModes, ["<C-n>"],
"Select next folder", "Select next folder",
@@ -488,7 +488,7 @@ function Mail() //{{{
} }
gFolderTreeView.selection.timedSelect(newPos, 500); gFolderTreeView.selection.timedSelect(newPos, 500);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<C-N>"], mappings.add(myModes, ["<C-N>"],
"Go to next mailbox with unread messages", "Go to next mailbox with unread messages",
@@ -496,7 +496,7 @@ function Mail() //{{{
{ {
selectUnreadFolder(false, count); selectUnreadFolder(false, count);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<C-p>"], mappings.add(myModes, ["<C-p>"],
"Select previous folder", "Select previous folder",
@@ -511,7 +511,7 @@ function Mail() //{{{
} }
gFolderTreeView.selection.timedSelect(newPos, 500); gFolderTreeView.selection.timedSelect(newPos, 500);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<C-P>"], mappings.add(myModes, ["<C-P>"],
"Go to previous mailbox with unread messages", "Go to previous mailbox with unread messages",
@@ -519,7 +519,7 @@ function Mail() //{{{
{ {
selectUnreadFolder(true, count); selectUnreadFolder(true, count);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
// THREADING // THREADING
mappings.add(myModes, ["za"], mappings.add(myModes, ["za"],
@@ -545,22 +545,22 @@ function Mail() //{{{
mappings.add(myModes, ["<C-i>"], mappings.add(myModes, ["<C-i>"],
"Go forward", "Go forward",
function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.forward, true); }, function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.forward, true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["<C-o>"], mappings.add(myModes, ["<C-o>"],
"Go back", "Go back",
function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.back, true); }, function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.back, true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["gg"], mappings.add(myModes, ["gg"],
"Select first message", "Select first message",
function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.firstMessage, true); }, function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.firstMessage, true); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add(myModes, ["G"], mappings.add(myModes, ["G"],
"Select last message", "Select last message",
function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.lastMessage, false); }, function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.lastMessage, false); },
{ flags: Mappings.flags.COUNT }); { count: true });
// tagging messages // tagging messages
mappings.add(myModes, ["l"], mappings.add(myModes, ["l"],
@@ -583,7 +583,7 @@ function Mail() //{{{
} }
}, },
{ {
flags: Mappings.flags.ARGUMENT arg: true
}); });
// TODO: change binding? // TODO: change binding?

View File

@@ -1,7 +1,18 @@
2009-XX-XX: 2009-XX-XX:
* version 2.2a1pre * version 2.2a1pre
* IMPORTANT: Map.flags has been replaced with individual properties.
Mappings defined in plugins with mappings.add will need to be updated.
E.g.
mappings.add(...,
{ flags: Mappings.flags.ARGUMENT |
Mappings.flags.COUNT |
Mappings.flags.MOTION |
Mappings.flags.ALLOW_EVENT_ROUTING });
is now
mappings.add(...,
{ arg: true, count: true, motion: true, route: true });
* IMPORTANT: shifted key notation now matches Vim's behaviour. E.g. <C-a> * IMPORTANT: shifted key notation now matches Vim's behaviour. E.g. <C-a>
and <C-A> are equivalent, to map the uppercase character use <C-S-A>. and <C-A> are equivalent, to map the uppercase character use <C-S-A>. - Is this still true, or going to be true? --djk
* add -description option to :command * add -description option to :command
* command-line options are now supported via the host application's * command-line options are now supported via the host application's
-liberator option -liberator option

View File

@@ -233,12 +233,12 @@ const config = { //{{{
mappings.add([modes.NORMAL], mappings.add([modes.NORMAL],
["<C-a>"], "Increment last number in URL", ["<C-a>"], "Increment last number in URL",
function (count) { incrementURL(Math.max(count, 1)); }, function (count) { incrementURL(Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], mappings.add([modes.NORMAL],
["<C-x>"], "Decrement last number in URL", ["<C-x>"], "Decrement last number in URL",
function (count) { incrementURL(-Math.max(count, 1)); }, function (count) { incrementURL(-Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["~"], mappings.add([modes.NORMAL], ["~"],
"Open home directory", "Open home directory",
@@ -294,7 +294,7 @@ const config = { //{{{
else else
liberator.open(url); liberator.open(url);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["gU"], mappings.add([modes.NORMAL], ["gU"],
"Go to the root of the website", "Go to the root of the website",

View File

@@ -335,12 +335,12 @@ const config = { //{{{
mappings.add([modes.NORMAL], mappings.add([modes.NORMAL],
["<C-a>"], "Increment last number in URL", ["<C-a>"], "Increment last number in URL",
function (count) { incrementURL(Math.max(count, 1)); }, function (count) { incrementURL(Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], mappings.add([modes.NORMAL],
["<C-x>"], "Decrement last number in URL", ["<C-x>"], "Decrement last number in URL",
function (count) { incrementURL(-Math.max(count, 1)); }, function (count) { incrementURL(-Math.max(count, 1)); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["~"], mappings.add([modes.NORMAL], ["~"],
"Open home directory", "Open home directory",
@@ -396,7 +396,7 @@ const config = { //{{{
else else
liberator.open(url); liberator.open(url);
}, },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.NORMAL], ["gU"], mappings.add([modes.NORMAL], ["gU"],
"Go to the root of the website", "Go to the root of the website",

View File

@@ -150,22 +150,22 @@ function Player() // {{{
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["h", "<Left>"], "Seek -10s", ["h", "<Left>"], "Seek -10s",
function (count) { player.seekBackward(Math.max(1, count) * 10000); }, function (count) { player.seekBackward(Math.max(1, count) * 10000); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["l", "<Right>"], "Seek +10s", ["l", "<Right>"], "Seek +10s",
function (count) { player.seekForward(Math.max(1, count) * 10000); }, function (count) { player.seekForward(Math.max(1, count) * 10000); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["H", "<S-Left>"], "Seek -1m", ["H", "<S-Left>"], "Seek -1m",
function (count) { player.seekBackward(Math.max(1, count) * 60000); }, function (count) { player.seekBackward(Math.max(1, count) * 60000); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["L", "<S-Right>"], "Seek +1m", ["L", "<S-Right>"], "Seek +1m",
function (count) { player.seekForward(Math.max(1, count) * 60000); }, function (count) { player.seekForward(Math.max(1, count) * 60000); },
{ flags: Mappings.flags.COUNT }); { count: true });
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["=", "+"], "Increase volume by 10%", ["=", "+"], "Increase volume by 10%",