Mercurial > vim
diff src/testdir/test_normal.vim @ 12421:da55ea30842c v8.0.1090
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
commit https://github.com/vim/vim/commit/65f084749b260746d7f186af4f080298be2df55b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 10 18:16:20 2017 +0200
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>.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Sep 2017 18:30:05 +0200 |
parents | 2c655db9e0f6 |
children | 68d7bc045dbe |
line wrap: on
line diff
--- 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