mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 09:57:59 +01:00
use the coerced boolean value of args rather than testing for 0 string length
when determining if an arg was passed to an ex command
This commit is contained in:
@@ -623,7 +623,7 @@ function Commands() //{{{
|
|||||||
addDefaultCommand(new Command(["mapc[lear]"],
|
addDefaultCommand(new Command(["mapc[lear]"],
|
||||||
function(args)
|
function(args)
|
||||||
{
|
{
|
||||||
if (args.length > 0)
|
if (args)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("E474: Invalid argument");
|
vimperator.echoerr("E474: Invalid argument");
|
||||||
return;
|
return;
|
||||||
@@ -667,7 +667,7 @@ function Commands() //{{{
|
|||||||
function(args)
|
function(args)
|
||||||
{
|
{
|
||||||
// ignore invalid mark characters unless there are no valid mark chars
|
// ignore invalid mark characters unless there are no valid mark chars
|
||||||
if (args.length > 0 && !/[a-zA-Z]/.test(args))
|
if (args && !/[a-zA-Z]/.test(args))
|
||||||
{
|
{
|
||||||
vimperator.echoerr("E283: No marks matching \"" + args + "\"");
|
vimperator.echoerr("E283: No marks matching \"" + args + "\"");
|
||||||
return;
|
return;
|
||||||
@@ -756,8 +756,10 @@ function Commands() //{{{
|
|||||||
addDefaultCommand(new Command(["o[pen]", "e[dit]"],
|
addDefaultCommand(new Command(["o[pen]", "e[dit]"],
|
||||||
function(args, special)
|
function(args, special)
|
||||||
{
|
{
|
||||||
if (args.length > 0)
|
if (args)
|
||||||
|
{
|
||||||
vimperator.open(args);
|
vimperator.open(args);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (special)
|
if (special)
|
||||||
@@ -838,7 +840,7 @@ function Commands() //{{{
|
|||||||
function(args)
|
function(args)
|
||||||
{
|
{
|
||||||
// ignore invalid mark characters unless there are no valid mark chars
|
// ignore invalid mark characters unless there are no valid mark chars
|
||||||
if (args.length > 0 && !/[a-zA-Z0-9]/.test(args))
|
if (args && !/[a-zA-Z0-9]/.test(args))
|
||||||
{
|
{
|
||||||
vimperator.echoerr("E283: No QuickMarks matching \"" + args + "\"");
|
vimperator.echoerr("E283: No QuickMarks matching \"" + args + "\"");
|
||||||
return;
|
return;
|
||||||
@@ -1143,7 +1145,7 @@ function Commands() //{{{
|
|||||||
if (/\btabopen\b/.test(vimperator.options["activate"]))
|
if (/\btabopen\b/.test(vimperator.options["activate"]))
|
||||||
where = special ? vimperator.NEW_BACKGROUND_TAB : vimperator.NEW_TAB;
|
where = special ? vimperator.NEW_BACKGROUND_TAB : vimperator.NEW_TAB;
|
||||||
|
|
||||||
if (args.length > 0)
|
if (args)
|
||||||
vimperator.open(args, where);
|
vimperator.open(args, where);
|
||||||
else
|
else
|
||||||
vimperator.open("about:blank", where);
|
vimperator.open("about:blank", where);
|
||||||
|
|||||||
Reference in New Issue
Block a user