mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.0.1852: i_CTRL-O does not reset Select Mode (#24990)
Problem: i_CTRL-O does not reset Select Mode
Solution: Reset select mode on CTRL-O in insert mode
closes: vim/vim#13001
closes: vim/vim#12115
d69aecf141
Co-authored-by: pierreganty <pierreganty@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
f30844008b
commit
272c4fba83
@ -3579,6 +3579,7 @@ static void ins_insert(int replaceState)
|
|||||||
// Pressed CTRL-O in Insert mode.
|
// Pressed CTRL-O in Insert mode.
|
||||||
static void ins_ctrl_o(void)
|
static void ins_ctrl_o(void)
|
||||||
{
|
{
|
||||||
|
restart_VIsual_select = 0;
|
||||||
if (State & VREPLACE_FLAG) {
|
if (State & VREPLACE_FLAG) {
|
||||||
restart_edit = 'V';
|
restart_edit = 'V';
|
||||||
} else if (State & REPLACE_FLAG) {
|
} else if (State & REPLACE_FLAG) {
|
||||||
|
@ -312,4 +312,15 @@ func Test_selectmode_register()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_ins_ctrl_o_in_insert_mode_resets_selectmode()
|
||||||
|
new
|
||||||
|
" ctrl-o in insert mode resets restart_VIsual_select
|
||||||
|
call setline(1, 'abcdef')
|
||||||
|
call cursor(1, 1)
|
||||||
|
exe "norm! \<c-v>\<c-g>\<c-o>c\<c-o>\<c-v>\<right>\<right>IABC"
|
||||||
|
call assert_equal('ABCbcdef', getline(1))
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user