}
try {
- var tmpfile = io.createTempFile();
+ var tmpfile = io.createTempFile("txt", "." + buffer.uri.host);
if (!tmpfile)
throw Error(_("io.cantCreateTempFile"));
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" });
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 });
},
{ 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);
}
});
-// vim: set fdm=marker sw=4 ts=4 et:
+// vim: set fdm=marker sw=4 sts=4 ts=8 et: