forked from aniani/vim
patch 8.2.2969: subtracting from number option fails when result is zero
Problem: Subtracting from number option fails when result is zero. (Ingo Karkat) Solution: Reset the string value when using the numeric value. (closes #8351)
This commit is contained in:
@@ -1439,6 +1439,7 @@ ex_let_one(
|
|||||||
case '%': n = (long)num_modulus(numval, n,
|
case '%': n = (long)num_modulus(numval, n,
|
||||||
&failed); break;
|
&failed); break;
|
||||||
}
|
}
|
||||||
|
s = NULL;
|
||||||
}
|
}
|
||||||
else if (opt_type == gov_string
|
else if (opt_type == gov_string
|
||||||
&& stringval != NULL && s != NULL)
|
&& stringval != NULL && s != NULL)
|
||||||
|
@@ -7083,6 +7083,15 @@ func Test_compound_assignment_operators()
|
|||||||
call assert_fails('let &scrolljump .= "j"', 'E734:')
|
call assert_fails('let &scrolljump .= "j"', 'E734:')
|
||||||
set scrolljump&vim
|
set scrolljump&vim
|
||||||
|
|
||||||
|
let &foldlevelstart = 2
|
||||||
|
let &foldlevelstart -= 1
|
||||||
|
call assert_equal(1, &foldlevelstart)
|
||||||
|
let &foldlevelstart -= 1
|
||||||
|
call assert_equal(0, &foldlevelstart)
|
||||||
|
let &foldlevelstart = 2
|
||||||
|
let &foldlevelstart -= 2
|
||||||
|
call assert_equal(0, &foldlevelstart)
|
||||||
|
|
||||||
" Test for register
|
" Test for register
|
||||||
let @/ = 1
|
let @/ = 1
|
||||||
call assert_fails('let @/ += 1', 'E734:')
|
call assert_fails('let @/ += 1', 'E734:')
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2969,
|
||||||
/**/
|
/**/
|
||||||
2968,
|
2968,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user