From 419819b6245e120aba8897e3ddea711b2cd0246c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 5 Mar 2023 09:18:42 +0800 Subject: vim-patch:9.0.1380: CTRL-X on 2**64 subtracts two (#22530) Problem: CTRL-X on 2**64 subtracts two. (James McCoy) Solution: Correct computation for large number. (closes vim/vim#12103) https://github.com/vim/vim/commit/5fb78c3fa5c996c08a65431d698bd2c251eef5c7 Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_increment.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_increment.vim b/src/nvim/testdir/test_increment.vim index 3c2b88ef9f..433b2b4471 100644 --- a/src/nvim/testdir/test_increment.vim +++ b/src/nvim/testdir/test_increment.vim @@ -841,6 +841,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\" + call assert_equal('18446744073709551615', getline(1)) + + exec "norm! gg0\" + call assert_equal('18446744073709551614', getline(1)) + + exec "norm! gg0\" + call assert_equal('18446744073709551615', getline(1)) + + exec "norm! gg0\" + call assert_equal('-18446744073709551615', getline(1)) +endfunc + func Test_normal_increment_with_virtualedit() set virtualedit=all -- cgit