1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 16:37:58 +01:00

Use Files rather than strings in io.js where possible. Add some missing docs.

This commit is contained in:
Kris Maglione
2011-01-20 02:23:30 -05:00
parent 11f4ee5d58
commit 0ea2633593
4 changed files with 89 additions and 40 deletions

View File

@@ -241,9 +241,21 @@ var Editor = Module("editor", {
return -1;
},
/**
* Edits the given file in the external editor as specified by the
* 'editor' option.
*
* @param {object|File|string} args An object specifying the file,
* line, and column to edit. If a non-object is specified, it is
* treated as the file parameter of the object.
* @param {boolean} blocking If true, this function does not return
* until the editor exits.
*/
editFileExternally: function (args, blocking) {
if (!isObject(args))
if (!isObject(args) || args instanceof File)
args = { file: args };
args.file = args.file.path || args.file;
let args = options.get("editor").format(args);
dactyl.assert(args.length >= 1, "No editor specified");