1
0
forked from aniani/vim

patch 9.0.1380: CTRL-X on 2**64 subtracts two

Problem:    CTRL-X on 2**64 subtracts two. (James McCoy)
Solution:   Correct computation for large number. (closes #12103)
This commit is contained in:
Bram Moolenaar
2023-03-04 20:47:39 +00:00
parent 5284b23e14
commit 5fb78c3fa5
12 changed files with 69 additions and 21 deletions

View File

@@ -840,6 +840,22 @@ func Test_increment_unsigned()
set nrformats-=unsigned
endfunc
func Test_in_decrement_large_number()
" NOTE: 18446744073709551616 == 2^64
call setline(1, '18446744073709551616')
exec "norm! gg0\<C-X>"
call assert_equal('18446744073709551615', getline(1))
exec "norm! gg0\<C-X>"
call assert_equal('18446744073709551614', getline(1))
exec "norm! gg0\<C-A>"
call assert_equal('18446744073709551615', getline(1))
exec "norm! gg0\<C-A>"
call assert_equal('-18446744073709551615', getline(1))
endfunc
func Test_normal_increment_with_virtualedit()
set virtualedit=all