Patch 8.1.1189
Problem:    Mode is not cleared when leaving Insert mode.
Solution:   Clear the mode when got_int is set. (Ozaki Kiichi, closes #4270)
Files:      src/edit.c, src/testdir/test_bufline.vim,
            src/testdir/test_messages.vim


*** ../vim-8.1.1188/src/edit.c  2019-03-30 18:46:57.344077426 +0100
--- src/edit.c  2019-04-20 14:55:19.719612597 +0200
***************
*** 4564,4570 ****
       */
      if (reg_recording != 0 || restart_edit != NUL)
        showmode();
!     else if (p_smd && !skip_showmode())
        msg("");
  
      return TRUE;          /* exit Insert mode */
--- 4564,4570 ----
       */
      if (reg_recording != 0 || restart_edit != NUL)
        showmode();
!     else if (p_smd && (got_int || !skip_showmode()))
        msg("");
  
      return TRUE;          /* exit Insert mode */
*** ../vim-8.1.1188/src/testdir/test_bufline.vim        2018-09-21 
16:59:40.113489779 +0200
--- src/testdir/test_bufline.vim        2019-04-20 14:55:19.719612597 +0200
***************
*** 18,24 ****
    let b = bufnr('%')
    wincmd w
    call assert_equal(1, setbufline(b, 5, ['x']))
!   call assert_equal(1, setbufline(1234, 1, ['x']))
    call assert_equal(0, setbufline(b, 4, ['d', 'e']))
    call assert_equal(['c'], getbufline(b, 3))
    call assert_equal(['d'], getbufline(b, 4))
--- 18,24 ----
    let b = bufnr('%')
    wincmd w
    call assert_equal(1, setbufline(b, 5, ['x']))
!   call assert_equal(1, setbufline(bufnr('$') + 1, 1, ['x']))
    call assert_equal(0, setbufline(b, 4, ['d', 'e']))
    call assert_equal(['c'], getbufline(b, 3))
    call assert_equal(['d'], getbufline(b, 4))
*** ../vim-8.1.1188/src/testdir/test_messages.vim       2019-01-09 
23:00:58.001176090 +0100
--- src/testdir/test_messages.vim       2019-04-20 14:55:19.719612597 +0200
***************
*** 1,5 ****
--- 1,7 ----
  " Tests for :messages, :echomsg, :echoerr
  
+ source shared.vim
+ 
  function Test_messages()
    let oldmore = &more
    try
***************
*** 92,94 ****
--- 94,127 ----
    call assert_match("function('<lambda>\\d*')", execute(':echoerr {-> 1234}'))
    call test_ignore_error('RESET')
  endfunc
+ 
+ func Test_mode_message_at_leaving_insert_by_ctrl_c()
+   if !has('terminal') || has('gui_running')
+     return
+   endif
+ 
+   " Set custom statusline built by user-defined function.
+   let testfile = 'Xtest.vim'
+   call writefile([
+         \ 'func StatusLine() abort',
+         \ '  return ""',
+         \ 'endfunc',
+         \ 'set statusline=%!StatusLine()',
+         \ 'set laststatus=2',
+         \ ], testfile)
+ 
+   let rows = 10
+   let buf = term_start([GetVimProg(), '--clean', '-S', testfile], 
{'term_rows': rows})
+   call term_wait(buf, 200)
+   call assert_equal('run', job_status(term_getjob(buf)))
+ 
+   call term_sendkeys(buf, "i")
+   call WaitForAssert({-> assert_match('^-- INSERT --\s*$', term_getline(buf, 
rows))})
+   call term_sendkeys(buf, "\<C-C>")
+   call WaitForAssert({-> assert_match('^\s*$', term_getline(buf, rows))})
+ 
+   call term_sendkeys(buf, ":qall!\<CR>")
+   call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
+   exe buf . 'bwipe!'
+   call delete(testfile)
+ endfunc
*** ../vim-8.1.1188/src/version.c       2019-04-20 14:39:42.796386124 +0200
--- src/version.c       2019-04-20 15:06:03.740022909 +0200
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1189,
  /**/

-- 
Experience is what you get when you don't get what you want.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui