diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-12 23:38:33 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-18 18:01:43 -0400 |
| commit | 833a5d16a21aac58367c2cedbc7a34f321183e76 (patch) | |
| tree | f994bb5e4260aaa653a7ddf709977a0bafb69200 /src/nvim/testdir | |
| parent | 3c9ec83395b4419e7030d35b5a92b6d008ca25ea (diff) | |
| download | rneovim-833a5d16a21aac58367c2cedbc7a34f321183e76.tar.gz rneovim-833a5d16a21aac58367c2cedbc7a34f321183e76.tar.bz2 rneovim-833a5d16a21aac58367c2cedbc7a34f321183e76.zip | |
vim-patch:8.2.0963: number increment/decrement does not work with 'virtualedit'
Problem: Number increment/decrement does not work with 'virtualedit'.
Solution: Handle coladd changing. (Christian Brabandt, closes vim/vim#6240,
closes vim/vim#923)
https://github.com/vim/vim/commit/6c6be9e88d72a60ee279ccad73d018c534b71d66
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_increment.vim | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_increment.vim b/src/nvim/testdir/test_increment.vim index ab11d943d9..f81f8edbde 100644 --- a/src/nvim/testdir/test_increment.vim +++ b/src/nvim/testdir/test_increment.vim @@ -779,4 +779,40 @@ func Test_increment_empty_line() bwipe! endfunc +func Test_normal_increment_with_virtualedit() + set virtualedit=all + + call setline(1, ["\<TAB>1"]) + exec "norm! 0\<C-A>" + call assert_equal("\<TAB>2", getline(1)) + call assert_equal([0, 1, 2, 0], getpos('.')) + + call setline(1, ["\<TAB>1"]) + exec "norm! 0l\<C-A>" + call assert_equal("\<TAB>2", getline(1)) + call assert_equal([0, 1, 2, 0], getpos('.')) + + call setline(1, ["\<TAB>1"]) + exec "norm! 07l\<C-A>" + call assert_equal("\<TAB>2", getline(1)) + call assert_equal([0, 1, 2, 0], getpos('.')) + + call setline(1, ["\<TAB>1"]) + exec "norm! 0w\<C-A>" + call assert_equal("\<TAB>2", getline(1)) + call assert_equal([0, 1, 2, 0], getpos('.')) + + call setline(1, ["\<TAB>1"]) + exec "norm! 0wl\<C-A>" + call assert_equal("\<TAB>1", getline(1)) + call assert_equal([0, 1, 3, 0], getpos('.')) + + call setline(1, ["\<TAB>1"]) + exec "norm! 0w30l\<C-A>" + call assert_equal("\<TAB>1", getline(1)) + call assert_equal([0, 1, 3, 29], getpos('.')) + + set virtualedit& +endfunc + " vim: shiftwidth=2 sts=2 expandtab |