mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-04 16:23:31 +02:00
Use WarningMsg rather than ErrorMsg for deprecation warnings.
This commit is contained in:
@@ -303,7 +303,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
commandline.echo(str, commandline.HL_NORMAL, flags);
|
commandline.echo(str, commandline.HL_NORMAL, flags);
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: Vim replaces unprintable characters in echoerr/echomsg
|
|
||||||
/**
|
/**
|
||||||
* Outputs an error message to the command line.
|
* Outputs an error message to the command line.
|
||||||
*
|
*
|
||||||
@@ -327,6 +326,17 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
commandline.echo(str, commandline.HL_ERRORMSG, flags);
|
commandline.echo(str, commandline.HL_ERRORMSG, flags);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outputs a warning message to the command line.
|
||||||
|
*
|
||||||
|
* @param {string} str The message to output.
|
||||||
|
* @param {number} flags These control the multi-line message behavior.
|
||||||
|
* See {@link CommandLine#echo}.
|
||||||
|
*/
|
||||||
|
warn: function warn(str, flags) {
|
||||||
|
commandline.echo(str, "WarningMsg", flags | commandline.APPEND_TO_MESSAGES);
|
||||||
|
},
|
||||||
|
|
||||||
// TODO: add proper level constants
|
// TODO: add proper level constants
|
||||||
/**
|
/**
|
||||||
* Outputs an information message to the command line.
|
* Outputs an information message to the command line.
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ function deprecated(alternative, fn) {
|
|||||||
"";
|
"";
|
||||||
let filename = (frame.filename || "unknown").replace(/.* -> /, "");
|
let filename = (frame.filename || "unknown").replace(/.* -> /, "");
|
||||||
if (!set.add(deprecatedMethod.seen, filename))
|
if (!set.add(deprecatedMethod.seen, filename))
|
||||||
util.dactyl(fn).echoerr(
|
util.dactyl(fn).warn(
|
||||||
util.urlPath(filename) + ":" + frame.lineNumber + ": " +
|
util.urlPath(filename) + ":" + frame.lineNumber + ": " +
|
||||||
obj + (fn.name || name) + " is deprecated: Please use " + alternative + " instead");
|
obj + (fn.name || name) + " is deprecated: Please use " + alternative + " instead");
|
||||||
return func.apply(this, arguments);
|
return func.apply(this, arguments);
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
|||||||
let msg = "Warning: setting preference " + name + ", but it's changed from its default value.";
|
let msg = "Warning: setting preference " + name + ", but it's changed from its default value.";
|
||||||
if (message)
|
if (message)
|
||||||
msg = template.linkifyHelp(msg + " " + message);
|
msg = template.linkifyHelp(msg + " " + message);
|
||||||
util.dactyl.echomsg(msg);
|
util.dactyl.warn(msg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user