mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 18:57:59 +01:00
Closes issue #769.
This commit is contained in:
@@ -783,14 +783,16 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
|||||||
preExecute: function preExecute(args) {
|
preExecute: function preExecute(args) {
|
||||||
if (editor.editor && !this.editor) {
|
if (editor.editor && !this.editor) {
|
||||||
this.editor = editor.editor;
|
this.editor = editor.editor;
|
||||||
this.editor.beginTransaction();
|
if (!this.noTransaction)
|
||||||
|
this.editor.beginTransaction();
|
||||||
}
|
}
|
||||||
editor.inEditMap = true;
|
editor.inEditMap = true;
|
||||||
},
|
},
|
||||||
postExecute: function preExecute(args) {
|
postExecute: function preExecute(args) {
|
||||||
editor.inEditMap = false;
|
editor.inEditMap = false;
|
||||||
if (this.editor) {
|
if (this.editor) {
|
||||||
this.editor.endTransaction();
|
if (!this.noTransaction)
|
||||||
|
this.editor.endTransaction();
|
||||||
this.editor = null;
|
this.editor = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1158,17 +1160,17 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
|||||||
// text edit mode
|
// text edit mode
|
||||||
bind(["u"], "Undo changes",
|
bind(["u"], "Undo changes",
|
||||||
function (args) {
|
function (args) {
|
||||||
editor.executeCommand("cmd_undo", Math.max(args.count, 1));
|
editor.editor.undo(Math.max(args.count, 1));
|
||||||
editor.deselect();
|
editor.deselect();
|
||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true, noTransaction: true });
|
||||||
|
|
||||||
bind(["<C-r>"], "Redo undone changes",
|
bind(["<C-r>"], "Redo undone changes",
|
||||||
function (args) {
|
function (args) {
|
||||||
editor.executeCommand("cmd_redo", Math.max(args.count, 1));
|
editor.editor.redo(Math.max(args.count, 1));
|
||||||
editor.deselect();
|
editor.deselect();
|
||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true, noTransaction: true });
|
||||||
|
|
||||||
bind(["D"], "Delete characters from the cursor to the end of the line",
|
bind(["D"], "Delete characters from the cursor to the end of the line",
|
||||||
function () { editor.executeCommand("cmd_deleteToEndOfLine"); });
|
function () { editor.executeCommand("cmd_deleteToEndOfLine"); });
|
||||||
|
|||||||
Reference in New Issue
Block a user