1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 19:47:58 +01:00

changed to error printing

This commit is contained in:
Martin Stubenschrott
2007-10-19 18:32:06 +00:00
parent 2c9fb23632
commit 0c505415a0

View File

@@ -303,18 +303,13 @@ function Editor() //{{{
this.editWithExternalEditor = function() this.editWithExternalEditor = function()
{ {
function err(msg)
{
vimperator.callFunctionInThread(null, vimperator.echoerr, [msg]);
}
var textBox = document.commandDispatcher.focusedElement; var textBox = document.commandDispatcher.focusedElement;
var editor = vimperator.options["editor"]; var editor = vimperator.options["editor"];
var args = []; var args = [];
args = editor.split(" "); args = editor.split(" ");
if (args.length < 1) if (args.length < 1)
{ {
err("no editor specified"); vimperator.echoerr("no editor specified");
return; return;
} }
@@ -324,7 +319,7 @@ function Editor() //{{{
} }
catch (e) catch (e)
{ {
err("Could not create temporary file: " + e.message); vimperator.echoerr("Could not create temporary file: " + e.message);
return; return;
} }
try try
@@ -333,7 +328,7 @@ function Editor() //{{{
} }
catch (e) catch (e)
{ {
err("Could not write to temporary file " + tmpfile.path + ": " + e.message); vimperator.echoerr("Could not write to temporary file " + tmpfile.path + ": " + e.message);
return; return;
} }
@@ -359,7 +354,7 @@ function Editor() //{{{
} }
catch (e) catch (e)
{ {
err("Could not read from temporary file " + tmpfile.path + ": " + e.message); vimperator.echoerr("Could not read from temporary file " + tmpfile.path + ": " + e.message);
} }
} }
tmpfile.remove(false); tmpfile.remove(false);