mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 05:38:01 +01:00
Make sure we end the transaction for the correct editor. Closes issue #683.
This commit is contained in:
@@ -440,6 +440,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
tmpfile.remove(false);
|
||||
|
||||
if (textBox) {
|
||||
DOM(textBox).highlight.remove("EditorEditing");
|
||||
if (!keepFocus)
|
||||
dactyl.focus(textBox);
|
||||
for (let group in values(blink.concat(blink, ""))) {
|
||||
@@ -478,9 +479,9 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
throw Error(_("io.cantCreateTempFile"));
|
||||
|
||||
if (textBox) {
|
||||
DOM(textBox).highlight.add("EditorEditing");
|
||||
if (!keepFocus)
|
||||
textBox.blur();
|
||||
DOM(textBox).highlight.add("EditorEditing");
|
||||
}
|
||||
|
||||
if (!tmpfile.write(text))
|
||||
@@ -779,14 +780,18 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
|
||||
Map.types["editor"] = {
|
||||
preExecute: function preExecute(args) {
|
||||
if (editor.editor)
|
||||
editor.editor.beginTransaction();
|
||||
if (editor.editor && !this.editor) {
|
||||
this.editor = editor.editor;
|
||||
this.editor.beginTransaction();
|
||||
}
|
||||
editor.inEditMap = true;
|
||||
},
|
||||
postExecute: function preExecute(args) {
|
||||
editor.inEditMap = false;
|
||||
if (editor.editor)
|
||||
editor.editor.endTransaction();
|
||||
if (this.editor) {
|
||||
this.editor.endTransaction();
|
||||
this.editor = null;
|
||||
}
|
||||
},
|
||||
};
|
||||
Map.types["operator"] = {
|
||||
|
||||
@@ -135,7 +135,8 @@ Dense /* Arbitrary elements which should be packed densely together
|
||||
margin-top: 0; margin-bottom: 0;
|
||||
|
||||
EditorEditing;;* /* Text fields for which an external editor is open */ \
|
||||
-moz-user-input: none !important; -moz-user-modify: read-only !important;
|
||||
-moz-user-input: none !important; -moz-user-modify: read-only !important; \
|
||||
background-color: #bbb !important;
|
||||
*EditorEditing>*;;* background-color: #bbb !important;
|
||||
EditorError;;* /* Text fields briefly after an error has occurred running the external editor */ \
|
||||
background: red !important;
|
||||
|
||||
Reference in New Issue
Block a user