X-Git-Url: https://git.donarmstrong.com/?p=dactyl.git;a=blobdiff_plain;f=common%2Fcontent%2Feditor.js;h=63ec3eb675b3e65fc32443f9365e445dcb9abee7;hp=262391ece5c0696b42388e4cc65c8082146a2764;hb=5ebd29f56d17f62011cdd596b1d351947ee534ff;hpb=9044153cb63835e39b9de8ec4ade237c03e3888a diff --git a/common/content/editor.js b/common/content/editor.js index 262391e..63ec3eb 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -280,7 +280,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { } }, - findChar: function findNumber(key, count, backward, offset) { + findChar: function findChar(key, count, backward, offset) { count = count || 1; // XXX ? offset = (offset || 0) - !!backward; @@ -455,7 +455,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { if (textBox) { textBox.value = val; - if (false) { + if (true) { let elem = DOM(textBox); elem.attrNS(NS, "modifiable", true) .style.MozUserInput; @@ -783,14 +783,16 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { preExecute: function preExecute(args) { if (editor.editor && !this.editor) { this.editor = editor.editor; - this.editor.beginTransaction(); + if (!this.noTransaction) + this.editor.beginTransaction(); } editor.inEditMap = true; }, postExecute: function preExecute(args) { editor.inEditMap = false; if (this.editor) { - this.editor.endTransaction(); + if (!this.noTransaction) + this.editor.endTransaction(); this.editor = null; } }, @@ -1158,17 +1160,17 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { // text edit mode bind(["u"], "Undo changes", function (args) { - editor.executeCommand("cmd_undo", Math.max(args.count, 1)); + editor.editor.undo(Math.max(args.count, 1)); editor.deselect(); }, - { count: true }); + { count: true, noTransaction: true }); bind([""], "Redo undone changes", function (args) { - editor.executeCommand("cmd_redo", Math.max(args.count, 1)); + editor.editor.redo(Math.max(args.count, 1)); editor.deselect(); }, - { count: true }); + { count: true, noTransaction: true }); bind(["D"], "Delete characters from the cursor to the end of the line", function () { editor.executeCommand("cmd_deleteToEndOfLine"); });