aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-06 20:44:41 +0800
committerGitHub <noreply@github.com>2022-07-06 20:44:41 +0800
commitc84ae5706fb0c31c415fedbc15021e9b2ef46065 (patch)
treeeb972208a75d0a28213cc040bad4d093ab2aec89 /src/nvim/testdir
parent93c8fe77cbfd3934c7599196e573136f75f6e9af (diff)
parent1a490a5bc552fcdc299684b725c5044a9e9c73c7 (diff)
downloadrneovim-c84ae5706fb0c31c415fedbc15021e9b2ef46065.tar.gz
rneovim-c84ae5706fb0c31c415fedbc15021e9b2ef46065.tar.bz2
rneovim-c84ae5706fb0c31c415fedbc15021e9b2ef46065.zip
Merge pull request #19247 from zeertzjq/vim-8.2.4165
vim-patch:7.4.212,8.2.{4165,4221}: some functions in normal.c are too long
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_normal.vim41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index 82ba2cfd48..f146726b7b 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -1422,9 +1422,16 @@ func Test_normal27_bracket()
call assert_equal(5, line('.'))
call assert_equal(3, col('.'))
- " No mark after line 21, cursor moves to first non blank on current line
+ " No mark before line 1, cursor moves to first non-blank on current line
+ 1
+ norm! 5|['
+ call assert_equal(' 1 b', getline('.'))
+ call assert_equal(1, line('.'))
+ call assert_equal(3, col('.'))
+
+ " No mark after line 21, cursor moves to first non-blank on current line
21
- norm! $]'
+ norm! 5|]'
call assert_equal(' 21 b', getline('.'))
call assert_equal(21, line('.'))
call assert_equal(3, col('.'))
@@ -1441,12 +1448,40 @@ func Test_normal27_bracket()
call assert_equal(20, line('.'))
call assert_equal(8, col('.'))
+ " No mark before line 1, cursor does not move
+ 1
+ norm! 5|[`
+ call assert_equal(' 1 b', getline('.'))
+ call assert_equal(1, line('.'))
+ call assert_equal(5, col('.'))
+
+ " No mark after line 21, cursor does not move
+ 21
+ norm! 5|]`
+ call assert_equal(' 21 b', getline('.'))
+ call assert_equal(21, line('.'))
+ call assert_equal(5, col('.'))
+
+ " Count too large for [`
+ " cursor moves to first lowercase mark
+ norm! 99[`
+ call assert_equal(' 1 b', getline('.'))
+ call assert_equal(1, line('.'))
+ call assert_equal(7, col('.'))
+
+ " Count too large for ]`
+ " cursor moves to last lowercase mark
+ norm! 99]`
+ call assert_equal(' 20 b', getline('.'))
+ call assert_equal(20, line('.'))
+ call assert_equal(8, col('.'))
+
" clean up
bw!
endfunc
+" Test for ( and ) sentence movements
func Test_normal28_parenthesis()
- " basic testing for ( and )
new
call append(0, ['This is a test. With some sentences!', '', 'Even with a question? And one more. And no sentence here'])