]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/content/editor.js
Import r6948 from upstream hg supporting Firefox up to 24.*
[dactyl.git] / common / content / editor.js
index eef3c1ded03f38f4fecd42e038b8c192b47dafa3..01a25ebddb60346e5412d735ae2422b5716a99e1 100644 (file)
@@ -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(["<C-a>"], "Increment the next number",
-             function ({ count }) { editor.modifyNumber(count || 1) },
+             function ({ count }) { editor.modifyNumber(count || 1); },
              { count: true });
 
         bind(["<C-x>"], "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(["<C-r>"], "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(["<Esc>"], "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: