forked from aniani/vim
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user