Patch 8.2.5109
Problem:    Mode not updated after CTRL-O CTRL-C in Insert mode.
Solution:   Set redraw_mode and use it. (closes #10581)
Files:      src/main.c, src/normal.c, src/testdir/test_normal.vim,
            src/testdir/dumps/Test_mode_updated_1.dump


*** ../vim-8.2.5108/src/main.c  2022-06-13 21:42:40.945531339 +0100
--- src/main.c  2022-06-16 13:02:36.954992217 +0100
***************
*** 1419,1425 ****
                update_screen(0);
                mch_enable_flush();
            }
!           else if (redraw_cmdline || clear_cmdline)
                showmode();
            redraw_statuslines();
            if (need_maketitle)
--- 1419,1425 ----
                update_screen(0);
                mch_enable_flush();
            }
!           else if (redraw_cmdline || clear_cmdline || redraw_mode)
                showmode();
            redraw_statuslines();
            if (need_maketitle)
*** ../vim-8.2.5108/src/normal.c        2022-06-04 22:15:48.792982835 +0100
--- src/normal.c        2022-06-16 13:02:16.667135181 +0100
***************
*** 6788,6793 ****
--- 6788,6796 ----
                msg(_("Type  :qa  and press <Enter> to exit Vim"));
        }
  
+       if (restart_edit != 0)
+           redraw_mode = TRUE;  // remove "-- (insert) --"
+ 
        // Don't reset "restart_edit" when 'insertmode' is set, it won't be
        // set again below when halfway a mapping.
        if (!p_im)
*** ../vim-8.2.5108/src/testdir/test_normal.vim 2022-05-28 10:49:39.946234986 
+0100
--- src/testdir/test_normal.vim 2022-06-16 13:04:09.326382082 +0100
***************
*** 4,9 ****
--- 4,10 ----
  source check.vim
  source view_util.vim
  import './vim9.vim' as v9
+ source screendump.vim
  
  func Setup_NewWindow()
    10new
***************
*** 2458,2466 ****
    call assert_equal(2, line('.'))
    call assert_fails(':norm! g;', 'E662:')
    call assert_fails(':norm! g,', 'E663:')
!   let &ul=&ul
    call append('$', ['a', 'b', 'c', 'd'])
!   let &ul=&ul
    call append('$', ['Z', 'Y', 'X', 'W'])
    let a = execute(':changes')
    call assert_match('2\s\+0\s\+2', a)
--- 2459,2467 ----
    call assert_equal(2, line('.'))
    call assert_fails(':norm! g;', 'E662:')
    call assert_fails(':norm! g,', 'E663:')
!   let &ul = &ul
    call append('$', ['a', 'b', 'c', 'd'])
!   let &ul = &ul
    call append('$', ['Z', 'Y', 'X', 'W'])
    let a = execute(':changes')
    call assert_match('2\s\+0\s\+2', a)
***************
*** 3266,3271 ****
--- 3267,3286 ----
    bwipe!
  endfunc
  
+ func Test_mode_updated_after_ctrl_c()
+   CheckScreendump
+ 
+   let buf = RunVimInTerminal('', {'rows': 5})
+   call term_sendkeys(buf, "i")
+   call term_sendkeys(buf, "\<C-O>")
+   " wait a moment so that the "-- (insert) --" message is displayed
+   call TermWait(buf, 50)
+   call term_sendkeys(buf, "\<C-C>")
+   call VerifyScreenDump(buf, 'Test_mode_updated_1', {})
+ 
+   call StopVimInTerminal(buf)
+ endfunc
+ 
  " Test for '[m', ']m', '[M' and ']M'
  " Jumping to beginning and end of methods in Java-like languages
  func Test_java_motion()
*** ../vim-8.2.5108/src/testdir/dumps/Test_mode_updated_1.dump  2022-06-16 
13:03:31.910621538 +0100
--- src/testdir/dumps/Test_mode_updated_1.dump  2022-06-16 12:54:19.066464482 
+0100
***************
*** 0 ****
--- 1,5 ----
+ > +0&#ffffff0@74
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ | +0#0000000&@56|0|,|0|-|1| @8|A|l@1| 
*** ../vim-8.2.5108/src/version.c       2022-06-16 12:10:42.987386331 +0100
--- src/version.c       2022-06-16 12:46:09.299311761 +0100
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     5109,
  /**/

-- 
Wi n0t trei a h0liday in Sweden thi yer?
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220616120516.783E01C2341%40moolenaar.net.

Raspunde prin e-mail lui