diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-09-10 18:16:20 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-09-10 18:16:20 +0200 |
commit | 65f084749b260746d7f186af4f080298be2df55b (patch) | |
tree | bff55e0c1924c835001e7dc92857e3e09e5433e1 /src/testdir/test_normal.vim | |
parent | c168bd4bd3a9b856fc410fc4515dcca1d10d7461 (diff) | |
download | vim-git-65f084749b260746d7f186af4f080298be2df55b.tar.gz |
patch 8.0.1090: cannot get the text under the cursor like v:beval_textv8.0.1090
Problem: cannot get the text under the cursor like v:beval_text
Solution: Add <cexpr>.
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r-- | src/testdir/test_normal.vim | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 21d6aa988..d33723b12 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -389,10 +389,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 |