1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 10:17:58 +01:00

Make sure we end the transaction for the correct editor. Closes issue #683.

This commit is contained in:
Kris Maglione
2011-10-07 05:13:04 -04:00
parent 06b12136ec
commit 49adaaf6ab
2 changed files with 12 additions and 6 deletions

View File

@@ -440,6 +440,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
tmpfile.remove(false); tmpfile.remove(false);
if (textBox) { if (textBox) {
DOM(textBox).highlight.remove("EditorEditing");
if (!keepFocus) if (!keepFocus)
dactyl.focus(textBox); dactyl.focus(textBox);
for (let group in values(blink.concat(blink, ""))) { for (let group in values(blink.concat(blink, ""))) {
@@ -478,9 +479,9 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
throw Error(_("io.cantCreateTempFile")); throw Error(_("io.cantCreateTempFile"));
if (textBox) { if (textBox) {
DOM(textBox).highlight.add("EditorEditing");
if (!keepFocus) if (!keepFocus)
textBox.blur(); textBox.blur();
DOM(textBox).highlight.add("EditorEditing");
} }
if (!tmpfile.write(text)) if (!tmpfile.write(text))
@@ -779,14 +780,18 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
Map.types["editor"] = { Map.types["editor"] = {
preExecute: function preExecute(args) { preExecute: function preExecute(args) {
if (editor.editor) if (editor.editor && !this.editor) {
editor.editor.beginTransaction(); this.editor = editor.editor;
this.editor.beginTransaction();
}
editor.inEditMap = true; editor.inEditMap = true;
}, },
postExecute: function preExecute(args) { postExecute: function preExecute(args) {
editor.inEditMap = false; editor.inEditMap = false;
if (editor.editor) if (this.editor) {
editor.editor.endTransaction(); this.editor.endTransaction();
this.editor = null;
}
}, },
}; };
Map.types["operator"] = { Map.types["operator"] = {

View File

@@ -135,7 +135,8 @@ Dense /* Arbitrary elements which should be packed densely together
margin-top: 0; margin-bottom: 0; margin-top: 0; margin-bottom: 0;
EditorEditing;;* /* Text fields for which an external editor is open */ \ 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; *EditorEditing>*;;* background-color: #bbb !important;
EditorError;;* /* Text fields briefly after an error has occurred running the external editor */ \ EditorError;;* /* Text fields briefly after an error has occurred running the external editor */ \
background: red !important; background: red !important;