1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 11:27:58 +01:00

extract editor.editFileExternally from buffer.viewSource and

editor.editWithExternalEditor
This commit is contained in:
Doug Kearns
2008-11-28 04:11:42 +00:00
parent b1c8e5e73c
commit 49d331f811
3 changed files with 26 additions and 37 deletions

View File

@@ -1312,31 +1312,14 @@ function Buffer() //{{{
docUrl, docCharset, reference, "selection");
},
// url is optional
viewSource: function (url, useExternalEditor)
{
url = url || buffer.URL;
if (useExternalEditor)
{
// TODO: make that a helper function
// TODO: save return value in v:shell_error
var editor = options["editor"];
var args = commands.parseArgs(editor, [], "*", true);
if (args.length < 1)
{
liberator.echoerr("No editor specified");
return;
}
var prog = args.shift();
args.push(url);
liberator.callFunctionInThread(null, io.run, prog, args, true);
}
editor.editFileExternally(url);
else
{
liberator.open("view-source:" + url);
}
},
zoomIn: function (steps, fullZoom)