mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 08:56:29 +00:00
Merge pull request #14248 from andymass/vim-8.2.2612
[RFC] vim-patch 8.2.{2612,2613}
This commit is contained in:
@@ -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:')
|
||||
|
Reference in New Issue
Block a user