vim-patch:8.2.2938: after using motion force from feedkeys() it sticks (#15240)

Problem:    After using motion force from feedkeys() it may not be reset.
Solution:   Clear motion_force in clearop(). (closes vim/vim#8323)
21492743e8
This commit is contained in:
Xiao 2021-08-29 23:08:39 +02:00 committed by GitHub
parent 4e66e74fd7
commit b35de6c525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -3277,6 +3277,7 @@ static void clearop(oparg_T *oap)
oap->regname = 0; oap->regname = 0;
oap->motion_force = NUL; oap->motion_force = NUL;
oap->use_reg_one = false; oap->use_reg_one = false;
motion_force = NUL;
} }
static void clearopbeep(oparg_T *oap) static void clearopbeep(oparg_T *oap)

View File

@ -861,6 +861,15 @@ func Test_visual_block_mode()
set tabstop& shiftwidth& set tabstop& shiftwidth&
endfunc endfunc
func Test_visual_force_motion_feedkeys()
onoremap <expr> i- execute('let g:mode = mode(1)')
call feedkeys('dvi-', 'x')
call assert_equal('nov', g:mode)
call feedkeys('di-', 'x')
call assert_equal('no', g:mode)
ounmap i-
endfunc
" Test block-insert using cursor keys for movement " Test block-insert using cursor keys for movement
func Test_visual_block_insert_cursor_keys() func Test_visual_block_insert_cursor_keys()
new new