1
0
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:
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);
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"] = {

View File

@@ -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;