mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:57:59 +01:00
replace some echo() calls with echomsg()
This commit is contained in:
@@ -836,7 +836,7 @@ function Commands() //{{{
|
||||
}
|
||||
else
|
||||
{
|
||||
liberator.echo("No user-defined commands found");
|
||||
liberator.echomsg("No user-defined commands found");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -128,7 +128,10 @@ function AutoCommands() //{{{
|
||||
{
|
||||
args = args.string;
|
||||
if (/^\s*$/.test(args))
|
||||
return liberator.echo("No matching autocommands");
|
||||
{
|
||||
liberator.echomsg("No matching autocommands");
|
||||
return;
|
||||
}
|
||||
|
||||
let [, event, url] = args.match(/^(\S+)(?:\s+(\S+))?$/);
|
||||
url = url || buffer.URL;
|
||||
@@ -148,7 +151,7 @@ function AutoCommands() //{{{
|
||||
// TODO: perhaps trigger could return the number of autocmds triggered
|
||||
// TODO: Perhaps this should take -args to pass to the command?
|
||||
if (!autocommands.get(event).some(function (c) c.pattern.test(url)))
|
||||
liberator.echo("No matching autocommands");
|
||||
liberator.echomsg("No matching autocommands");
|
||||
else
|
||||
autocommands.trigger(event, { url: url });
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ function IO() //{{{
|
||||
if (isAbsolutePath(args))
|
||||
{
|
||||
if (io.setCurrentDirectory(args))
|
||||
liberator.echo(io.getCurrentDirectory().path);
|
||||
liberator.echomsg(io.getCurrentDirectory().path);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -233,7 +233,7 @@ function IO() //{{{
|
||||
if (dir.exists() && dir.isDirectory() && dir.isReadable())
|
||||
{
|
||||
io.setCurrentDirectory(dir.path);
|
||||
liberator.echo(io.getCurrentDirectory().path);
|
||||
liberator.echomsg(io.getCurrentDirectory().path);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ function IO() //{{{
|
||||
|
||||
commands.add(["pw[d]"],
|
||||
"Print the current directory name",
|
||||
function () { liberator.echo(io.getCurrentDirectory().path); },
|
||||
function () { liberator.echomsg(io.getCurrentDirectory().path); },
|
||||
{ argCount: "0" });
|
||||
|
||||
// "mkv[imperatorrc]" or "mkm[uttatorrc]"
|
||||
|
||||
@@ -919,7 +919,7 @@ const liberator = (function () //{{{
|
||||
if (config.helpFiles.indexOf(helpFile) != -1)
|
||||
liberator.open("chrome://liberator/locale/" + helpFile, where);
|
||||
else
|
||||
liberator.echo("Sorry, help file " + helpFile.quote() + " not found");
|
||||
liberator.echomsg("Sorry, help file " + helpFile.quote() + " not found");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ function Mappings() //{{{
|
||||
// TODO: Move this to an ItemList to show this automatically
|
||||
if (list.*.length() == list.text().length())
|
||||
{
|
||||
liberator.echo("No mapping found");
|
||||
liberator.echomsg("No mapping found");
|
||||
return;
|
||||
}
|
||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||
|
||||
@@ -443,7 +443,7 @@ function Options() //{{{
|
||||
if (str.*.length())
|
||||
liberator.echo(str, commandline.FORCE_MULTILINE);
|
||||
else
|
||||
liberator.echo("No variables found");
|
||||
liberator.echomsg("No variables found");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ function Tabs() //{{{
|
||||
}
|
||||
|
||||
if (removed > 0)
|
||||
liberator.echo(removed + " fewer tab(s)");
|
||||
liberator.echomsg(removed + " fewer tab(s)", 9);
|
||||
else
|
||||
liberator.echoerr("E94: No matching tab for " + args);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ function Addressbook() //{{{
|
||||
displayName = generateDisplayName(firstName, lastName);
|
||||
|
||||
if (addressbook.add(mailAddr, firstName, lastName, displayName))
|
||||
liberator.echo("Added address: " + displayName + " <" + mailAddr + ">", commandline.FORCE_SINGLELINE);
|
||||
liberator.echomsg("Added address: " + displayName + " <" + mailAddr + ">", 1, commandline.FORCE_SINGLELINE);
|
||||
else
|
||||
liberator.echoerr("Exxx: Could not add bookmark `" + mailAddr + "'", commandline.FORCE_SINGLELINE);
|
||||
|
||||
|
||||
@@ -138,12 +138,12 @@ function Mail() //{{{
|
||||
if (copy)
|
||||
{
|
||||
MsgCopyMessage(folders[0]);
|
||||
setTimeout(function () { liberator.echo(count + " message(s) copied to " + folders[0].prettyName); }, 100);
|
||||
setTimeout(function () { liberator.echomsg(count + " message(s) copied to " + folders[0].prettyName, 1); }, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
MsgMoveMessage(folders[0]);
|
||||
setTimeout(function () { liberator.echo(count + " message(s) moved to " + folders[0].prettyName); }, 100);
|
||||
setTimeout(function () { liberator.echomsg(count + " message(s) moved to " + folders[0].prettyName, 1); }, 100);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ function Bookmarks() //{{{
|
||||
if (bookmarks.add(false, title, url, keyword, tags, args.bang))
|
||||
{
|
||||
let extra = (title == url) ? "" : " (" + title + ")";
|
||||
liberator.echo("Added bookmark: " + url + extra, commandline.FORCE_SINGLELINE);
|
||||
liberator.echomsg("Added bookmark: " + url + extra, 1, commandline.FORCE_SINGLELINE);
|
||||
}
|
||||
else
|
||||
liberator.echoerr("Exxx: Could not add bookmark `" + title + "'", commandline.FORCE_SINGLELINE);
|
||||
@@ -368,7 +368,7 @@ function Bookmarks() //{{{
|
||||
let url = args.string || buffer.URL;
|
||||
let deletedCount = bookmarks.remove(url);
|
||||
|
||||
liberator.echo(deletedCount + " bookmark(s) with url `" + url + "' deleted", commandline.FORCE_SINGLELINE);
|
||||
liberator.echomsg(deletedCount + " bookmark(s) with url `" + url + "' deleted", 1, commandline.FORCE_SINGLELINE);
|
||||
},
|
||||
{
|
||||
argCount: "?",
|
||||
|
||||
Reference in New Issue
Block a user