aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_mapping.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_mapping.vim')
-rw-r--r--src/nvim/testdir/test_mapping.vim33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim
index c4807797ff..f88e8cf843 100644
--- a/src/nvim/testdir/test_mapping.vim
+++ b/src/nvim/testdir/test_mapping.vim
@@ -427,6 +427,30 @@ func Test_error_in_map_expr()
exe buf .. 'bwipe!'
endfunc
+func Test_expr_map_gets_cursor()
+ new
+ call setline(1, ['one', 'some w!rd'])
+ func StoreColumn()
+ let g:exprLine = line('.')
+ let g:exprCol = col('.')
+ return 'x'
+ endfunc
+ nnoremap <expr> x StoreColumn()
+ 2
+ nmap ! f!<Ignore>x
+ call feedkeys("!", 'xt')
+ call assert_equal('some wrd', getline(2))
+ call assert_equal(2, g:exprLine)
+ call assert_equal(7, g:exprCol)
+
+ bwipe!
+ unlet g:exprLine
+ unlet g:exprCol
+ delfunc StoreColumn
+ nunmap x
+ nunmap !
+endfunc
+
" Test for mapping errors
func Test_map_error()
call assert_fails('unmap', 'E474:')
@@ -535,4 +559,13 @@ func Test_map_cmdkey_redo()
ounmap i-
endfunc
+func Test_abbreviate_multi_byte()
+ new
+ iabbrev foo bar
+ call feedkeys("ifoo…\<Esc>", 'xt')
+ call assert_equal("bar…", getline(1))
+ iunabbrev foo
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab