patch 9.0.1852: i_CTRL-O does not reset Select Mode

Commit: 
https://github.com/vim/vim/commit/d69aecf141ff05a645d02f39f1cbf6381ed7d0c0
Author: pierreganty <pierrega...@gmail.com>
Date:   Sat Sep 2 21:59:52 2023 +0200

    patch 9.0.1852: i_CTRL-O does not reset Select Mode
    
    Problem:  i_CTRL-O does not reset Select Mode
    Solution: Reset select mode on CTRL-O in insert mode
    
    closes: #13001
    closes: #12115
    
    Signed-off-by: Christian Brabandt <c...@256bit.org>
    Co-authored-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/edit.c b/src/edit.c
index 0c902f895..a51542525 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -3859,6 +3859,7 @@ ins_insert(int replaceState)
     static void
 ins_ctrl_o(void)
 {
+    restart_VIsual_select = 0;
     if (State & VREPLACE_FLAG)
        restart_edit = 'V';
     else if (State & REPLACE_FLAG)
diff --git a/src/testdir/test_selectmode.vim b/src/testdir/test_selectmode.vim
index 6e2c36927..bf1b52b32 100644
--- a/src/testdir/test_selectmode.vim
+++ b/src/testdir/test_selectmode.vim
@@ -310,4 +310,15 @@ func Test_selectmode_register()
   bw!
 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
diff --git a/src/version.c b/src/version.c
index 605a61c4f..61fe83b78 100644
--- a/src/version.c
+++ b/src/version.c
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1852,
 /**/
     1851,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1qcX1L-00CV0I-Ie%40256bit.org.

Raspunde prin e-mail lui