patch 7.4.1992
Problem: Values for true and false can be confusing.
Solution: Update the documentation. Add a test. Make v:true evaluate to
TRUE for a non-zero-arg.
diff --git a/src/eval.c b/src/eval.c
index 4a1ad4f..69238c1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -9414,6 +9414,8 @@
{
return ((argvars[0].v_type == VAR_NUMBER
&& argvars[0].vval.v_number != 0)
+ || (argvars[0].v_type == VAR_SPECIAL
+ && argvars[0].vval.v_number == VVAL_TRUE)
|| (argvars[0].v_type == VAR_STRING
&& argvars[0].vval.v_string != NULL
&& *argvars[0].vval.v_string != NUL));
@@ -16350,7 +16352,13 @@
buf[1] = NUL;
buf[2] = NUL;
- if (VIsual_active)
+ if (time_for_testing == 93784)
+ {
+ /* Testing the two-character code. */
+ buf[0] = 'x';
+ buf[1] = '!';
+ }
+ else if (VIsual_active)
{
if (VIsual_select)
buf[0] = VIsual_mode + 's' - 'v';