fix: - :resetM doesn't break macros anymore

tweak: :listM now shows all built-in macros in alphabetical order, then all custom macros in alphabetical order.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4815 127b21dd-08f5-0310-b4b7-95ae10353056
master
Marc 2012-03-26 12:19:36 +00:00
parent 8905eb4162
commit 3261320d70
2 changed files with 6 additions and 4 deletions

View File

@ -62,7 +62,7 @@
"listM" = "listMacro()";
// Reload macros from plist, removing any custom ones.
"resetM" = "delete console.settings.macros; macros = console.settings.macros; undefined";
"resetM" = "macros = console.settings.macros = {}; undefined";
// Examining (“dumping”) objects
"d" = "dumpObject(eval(PARAM))";

View File

@ -497,18 +497,20 @@ this.deleteMacro = function deleteMacro(parameters)
this.listMacro = function listMacro()
{
var l=[];
var tmp,l=[];
for (var prop in defaultMacros)
{
l.push( ":" + prop);
}
l.sort();
tmp = l.join("\n"));
l=[];
for (var prop in macros)
{
if (!defaultMacros[prop]) l.push( ":" + prop);
}
l.sort();
consoleMessage("macro-list", l.join("\n"));
consoleMessage("macro-list", tmp + l.join("\n"));
}