aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-17 17:14:25 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-17 17:36:40 -0400
commit3d71366af1287f356a812a38f2c0b22230fe409c (patch)
tree81b03f32dac9257ab411c247c8e2b3e6a93bc0dc /src/nvim/testdir
parentf53c95e7a8cbeb6fb523d179ae166a3ace87dbcd (diff)
downloadrneovim-3d71366af1287f356a812a38f2c0b22230fe409c.tar.gz
rneovim-3d71366af1287f356a812a38f2c0b22230fe409c.tar.bz2
rneovim-3d71366af1287f356a812a38f2c0b22230fe409c.zip
vim-patch:8.0.1090: cannot get the text under the cursor like v:beval_text
Problem: cannot get the text under the cursor like v:beval_text Solution: Add <cexpr>. https://github.com/vim/vim/commit/65f084749b260746d7f186af4f080298be2df55b
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_normal.vim20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index 4c63bd1f71..035c778749 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -392,10 +392,22 @@ func! Test_normal10_expand()
call setline(1, ['1', 'ifooar,,cbar'])
2
norm! $
- let a=expand('<cword>')
- let b=expand('<cWORD>')
- call assert_equal('cbar', a)
- call assert_equal('ifooar,,cbar', b)
+ call assert_equal('cbar', expand('<cword>'))
+ call assert_equal('ifooar,,cbar', expand('<cWORD>'))
+
+ call setline(1, ['prx = list[idx];'])
+ 1
+ let expected = ['', 'prx', 'prx', 'prx',
+ \ 'list', 'list', 'list', 'list', 'list', 'list', 'list',
+ \ 'idx', 'idx', 'idx', 'idx',
+ \ 'list[idx]',
+ \ '];',
+ \ ]
+ for i in range(1, 16)
+ exe 'norm ' . i . '|'
+ call assert_equal(expected[i], expand('<cexpr>'), 'i == ' . i)
+ endfor
+
" clean up
bw!
endfunc