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

Add liberator.assert.

This commit is contained in:
Kris Maglione
2009-11-03 02:36:48 -05:00
parent 34e9b10fb9
commit 1ce498401e
13 changed files with 154 additions and 152 deletions

View File

@@ -177,8 +177,8 @@ function Editor() //{{{
function (args)
{
let matches = args.string.match(RegExp("^\\s*($|" + abbrevmatch + ")(?:\\s*$|\\s+(.*))"));
if (!matches)
return void liberator.echoerr("E474: Invalid argument");
liberator.assert(matches, "E474: Invalid argument");
let [, lhs, rhs] = matches;
if (rhs)
editor.addAbbreviation(mode, lhs, rhs);
@@ -844,8 +844,7 @@ function Editor() //{{{
// TODO: save return value in v:shell_error
let args = commands.parseArgs(options["editor"], [], "*", true);
if (args.length < 1)
return void liberator.echoerr("No editor specified");
liberator.assert(args.length >= 1, "No editor specified");
args.push(path);
liberator.callFunctionInThread(null, io.run, io.expandPath(args.shift()), args, true);