0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

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:
Bram Moolenaar
2021-06-10 18:43:25 +02:00
parent 54656015d3
commit a42e6e0082
3 changed files with 12 additions and 0 deletions

View File

@@ -7083,6 +7083,15 @@ func Test_compound_assignment_operators()
call assert_fails('let &scrolljump .= "j"', 'E734:')
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
let @/ = 1
call assert_fails('let @/ += 1', 'E734:')