X-Git-Url: https://git.donarmstrong.com/dactyl.git?a=blobdiff_plain;f=common%2Fcontent%2Feditor.js;h=01a25ebddb60346e5412d735ae2422b5716a99e1;hb=3d837eb266a3a01d424192aa4ec1a167366178c5;hp=eef3c1ded03f38f4fecd42e038b8c192b47dafa3;hpb=d8a3bcebff36df7b128b36e0b57b715479e155a0;p=dactyl.git diff --git a/common/content/editor.js b/common/content/editor.js index eef3c1d..01a25eb 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -470,7 +470,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { } try { - var tmpfile = io.createTempFile(); + var tmpfile = io.createTempFile("txt", "." + buffer.uri.host); if (!tmpfile) throw Error(_("io.cantCreateTempFile")); @@ -870,7 +870,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { function addBeginInsertModeMap(keys, commands, description) { mappings.add([modes.TEXT_EDIT], keys, description || "", function () { - commands.forEach(function (cmd) { editor.executeCommand(cmd, 1) }); + commands.forEach(function (cmd) { editor.executeCommand(cmd, 1); }); modes.push(modes.INSERT); }, { type: "editor" }); @@ -1148,26 +1148,25 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { mappings.add([modes.TEXT_EDIT], names, description, action, update({ type: "editor" }, params)); - bind([""], "Increment the next number", - function ({ count }) { editor.modifyNumber(count || 1) }, + function ({ count }) { editor.modifyNumber(count || 1); }, { count: true }); bind([""], "Decrement the next number", - function ({ count }) { editor.modifyNumber(-(count || 1)) }, + function ({ count }) { editor.modifyNumber(-(count || 1)); }, { count: true }); // text edit mode bind(["u"], "Undo changes", - function (args) { - editor.editor.undo(Math.max(args.count, 1)); + function ({ count }) { + editor.editor.undo(Math.max(count, 1)); editor.deselect(); }, { count: true, noTransaction: true }); bind([""], "Redo undone changes", - function (args) { - editor.editor.redo(Math.max(args.count, 1)); + function ({ count }) { + editor.editor.redo(Math.max(count, 1)); editor.deselect(); }, { count: true, noTransaction: true }); @@ -1325,8 +1324,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { }, { count: true }); - let bind = function bind() mappings.add.apply(mappings, - [[modes.AUTOCOMPLETE]].concat(Array.slice(arguments))) + let bind = function bind(...args) mappings.add.apply(mappings, [[modes.AUTOCOMPLETE]].concat(args)); bind([""], "Return to Insert mode", function () Events.PASS_THROUGH); @@ -1407,4 +1405,4 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { } }); -// vim: set fdm=marker sw=4 ts=4 et: +// vim: set fdm=marker sw=4 sts=4 ts=8 et: