0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.2074: Vim9: using :normal from Vim9 script can't handle range

Problem:    Vim9: using :normal from Vim9 script can't handle range.
Solution:   Execute a :normal command in legacy script context. (closes #7401)
This commit is contained in:
Bram Moolenaar
2020-12-01 20:12:24 +01:00
parent 4b8a065145
commit 4324d87a44
4 changed files with 22 additions and 3 deletions

View File

@@ -2958,6 +2958,19 @@ def Test_put_with_linebreak()
bwipe!
enddef
def InvokeNormal()
exe "norm! :m+1\r"
enddef
def Test_invoke_normal_in_visual_mode()
xnoremap <F3> <Cmd>call <SID>InvokeNormal()<CR>
new
setline(1, ['aaa', 'bbb'])
feedkeys("V\<F3>", 'xt')
assert_equal(['bbb', 'aaa'], getline(1, 2))
xunmap <F3>
enddef
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new