1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 03:07:58 +01:00

make error messages generated by :set more Vim-like

This commit is contained in:
Doug Kearns
2007-06-25 12:06:51 +00:00
parent cadf4f5457
commit a3d463d8bb

View File

@@ -1616,7 +1616,7 @@ function set(args, special)
{ {
var num = parseInt(val, 10); var num = parseInt(val, 10);
if (isNaN(num)) if (isNaN(num))
vimperator.echoerr("Invalid argument type to option " + option.name + ": Expects number"); vimperator.echoerr("E521: Number required after =: " + option.name + "=" + val);
else else
{ {
var cur_val = option.value; var cur_val = option.value;
@@ -1624,7 +1624,7 @@ function set(args, special)
if (oper == '-') num = cur_val - num; if (oper == '-') num = cur_val - num;
// FIXME // FIXME
if (option.validator != null && option.validator.call(this, num) == false) if (option.validator != null && option.validator.call(this, num) == false)
vimperator.echoerr("Invalid argument to option " + option.name + ": Check help for more details"); vimperator.echoerr("E521: Number required after =: " + option.name + "=" + val);
else // all checks passed, execute option handler else // all checks passed, execute option handler
option.value = num; option.value = num;
} }
@@ -1650,12 +1650,12 @@ function set(args, special)
} }
// FIXME // FIXME
if (option.validator != null && option.validator.call(this, val) == false) if (option.validator != null && option.validator.call(this, val) == false)
vimperator.echoerr("Invalid argument to option " + option.name + ": Check help for more details"); vimperator.echoerr("E474: Invalid argument: " + option.name + "=" + val);
else // all checks passed, execute option handler else // all checks passed, execute option handler
option.value = val; option.value = val;
} }
else else
vimperator.echoerr("Internal error, option format `" + type + "' not supported"); vimperator.echoerr("E685: Internal error: option format `" + type + "' not supported");
} }
} }
} }