mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 15:37:59 +01:00
blink text box after editing with external editor
This commit is contained in:
@@ -336,14 +336,19 @@ vimperator.Editor = function() //{{{
|
|||||||
args.push(tmpfile.path)
|
args.push(tmpfile.path)
|
||||||
|
|
||||||
textBox.setAttribute("readonly", "true");
|
textBox.setAttribute("readonly", "true");
|
||||||
|
var oldBg = textBox.style.backgroundColor;
|
||||||
|
var tmpBg = "yellow";
|
||||||
|
textBox.style.backgroundColor = "#bbbbbb";
|
||||||
var newThread = Components.classes["@mozilla.org/thread-manager;1"].getService().newThread(0);
|
var newThread = Components.classes["@mozilla.org/thread-manager;1"].getService().newThread(0);
|
||||||
// TODO: save return value in v:shell_error
|
// TODO: save return value in v:shell_error
|
||||||
vimperator.callFunctionInThread(newThread, vimperator.run, [prog, args, true]);
|
vimperator.callFunctionInThread(newThread, vimperator.run, [prog, args, true]);
|
||||||
textBox.removeAttribute("readonly");
|
textBox.removeAttribute("readonly");
|
||||||
|
|
||||||
// if (retcode != 0)
|
|
||||||
|
// if (v:shell_error != 0)
|
||||||
// {
|
// {
|
||||||
// err("External editor returned with exit code " + retcode);
|
// tmpBg = "red";
|
||||||
|
// vimperator.echoerr("External editor returned with exit code " + retcode);
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
{
|
{
|
||||||
@@ -354,9 +359,24 @@ vimperator.Editor = function() //{{{
|
|||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
|
tmpBg = "red";
|
||||||
vimperator.echoerr("Could not read from temporary file " + tmpfile.path + ": " + e.message);
|
vimperator.echoerr("Could not read from temporary file " + tmpfile.path + ": " + e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// blink the textbox after returning
|
||||||
|
var timeout = 100;
|
||||||
|
textBox.style.backgroundColor = tmpBg;
|
||||||
|
setTimeout( function() {
|
||||||
|
textBox.style.backgroundColor = oldBg;
|
||||||
|
setTimeout( function() {
|
||||||
|
textBox.style.backgroundColor = tmpBg;
|
||||||
|
setTimeout( function() {
|
||||||
|
textBox.style.backgroundColor = oldBg;
|
||||||
|
}, timeout);
|
||||||
|
}, timeout);
|
||||||
|
}, timeout);
|
||||||
|
|
||||||
tmpfile.remove(false);
|
tmpfile.remove(false);
|
||||||
}
|
}
|
||||||
} //}}}
|
} //}}}
|
||||||
|
|||||||
@@ -377,7 +377,6 @@ vimperator.Options = function() //{{{
|
|||||||
// this hack is only needed, because we need to do asynchronous loading of the .vimperatorrc
|
// this hack is only needed, because we need to do asynchronous loading of the .vimperatorrc
|
||||||
this.setInitialGUI = function()
|
this.setInitialGUI = function()
|
||||||
{
|
{
|
||||||
dump("initial GUI: ");// + guioptions_done + " - " + laststatus_done + " - " + tabline_done );
|
|
||||||
if (!guioptions_done)
|
if (!guioptions_done)
|
||||||
this.get("guioptions").reset();
|
this.get("guioptions").reset();
|
||||||
if (!laststatus_done)
|
if (!laststatus_done)
|
||||||
|
|||||||
Reference in New Issue
Block a user