1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 08:37:59 +01:00

Convert expression closures to arrow syntax.

This commit is contained in:
Doug Kearns
2013-09-15 00:42:51 +10:00
parent 6eeb0f50a2
commit 6ee830dfad
53 changed files with 702 additions and 703 deletions

View File

@@ -381,7 +381,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
textBox = null;
let line, column;
let keepFocus = modes.stack.some(function (m) isinstance(m.main, modes.COMMAND_LINE));
let keepFocus = modes.stack.some(m => isinstance(m.main, modes.COMMAND_LINE));
if (!forceEditing && textBox && textBox.type == "password") {
commandline.input(_("editor.prompt.editPassword") + " ",
@@ -400,7 +400,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
var editor_ = window.GetCurrentEditor ? GetCurrentEditor()
: Editor.getEditor(document.commandDispatcher.focusedWindow);
dactyl.assert(editor_);
text = Array.map(editor_.rootElement.childNodes, function (e) DOM.stringify(e, true)).join("");
text = Array.map(editor_.rootElement.childNodes, e => DOM.stringify(e, true)).join("");
if (!editor_.selection.rangeCount)
var sel = "";
@@ -1131,7 +1131,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
"<*-Home>", "<*-End>", "<*-PageUp>", "<*-PageDown>",
"<M-c>", "<M-v>", "<*-Tab>"],
"Handled by " + config.host,
function () Events.PASS_THROUGH);
() => Events.PASS_THROUGH);
mappings.add([modes.INSERT],
["<Space>", "<Return>"], "Expand Insert mode abbreviation",
@@ -1327,19 +1327,19 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
let bind = function bind(...args) mappings.add.apply(mappings, [[modes.AUTOCOMPLETE]].concat(args));
bind(["<Esc>"], "Return to Insert mode",
function () Events.PASS_THROUGH);
() => Events.PASS_THROUGH);
bind(["<C-[>"], "Return to Insert mode",
function () { events.feedkeys("<Esc>", { skipmap: true }); });
bind(["<Up>"], "Select the previous autocomplete result",
function () Events.PASS_THROUGH);
() => Events.PASS_THROUGH);
bind(["<C-p>"], "Select the previous autocomplete result",
function () { events.feedkeys("<Up>", { skipmap: true }); });
bind(["<Down>"], "Select the next autocomplete result",
function () Events.PASS_THROUGH);
() => Events.PASS_THROUGH);
bind(["<C-n>"], "Select the next autocomplete result",
function () { events.feedkeys("<Down>", { skipmap: true }); });
@@ -1350,8 +1350,8 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
"string", 'gvim -f +<line> +"sil! call cursor(0, <column>)" <file>', {
format: function (obj, value) {
let args = commands.parseArgs(value || this.value, { argCount: "*", allowUnknownOptions: true })
.map(util.compileMacro).filter(function (fmt) fmt.valid(obj))
.map(function (fmt) fmt(obj));
.map(util.compileMacro).filter(fmt => fmt.valid(obj))
.map(fmt => fmt(obj));
if (obj["file"] && !this.has("file"))
args.push(obj["file"]);
return args;
@@ -1359,7 +1359,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
has: function (key) Set.has(util.compileMacro(this.value).seen, key),
validator: function (value) {
this.format({}, value);
return Object.keys(util.compileMacro(value).seen).every(function (k) ["column", "file", "line"].indexOf(k) >= 0);
return Object.keys(util.compileMacro(value).seen).every(k => ["column", "file", "line"].indexOf(k) >= 0);
}
});