Patch 8.2.2686
Problem:    Status line is not updated when going to cmdline mode.
Solution:   Redraw status lines if 'statusline' is set and going to status
            line mode. (based on patch from Justin M. Keyes et al.,
            closes #8044)
Files:      src/ex_getln.c, src/testdir/test_statusline.vim,
            src/testdir/dumps/Test_statusline_mode_1.dump,
            src/testdir/dumps/Test_statusline_mode_2.dump


*** ../vim-8.2.2685/src/ex_getln.c      2021-02-10 16:45:21.395462258 +0100
--- src/ex_getln.c      2021-04-01 18:46:29.874117319 +0200
***************
*** 1706,1711 ****
--- 1706,1720 ----
      // and execute commands. Display may be messed up a bit.
      if (did_emsg)
        redrawcmd();
+ 
+     // Redraw the statusline in case it uses the current mode using the mode()
+     // function.
+     if (!cmd_silent && msg_scrolled == 0 && *p_stl != NUL)
+     {
+       curwin->w_redr_status = TRUE;
+       redraw_statuslines();
+     }
+ 
      did_emsg = FALSE;
      got_int = FALSE;
  
*** ../vim-8.2.2685/src/testdir/test_statusline.vim     2021-03-04 
21:55:54.601235264 +0100
--- src/testdir/test_statusline.vim     2021-04-01 18:44:44.506228257 +0200
***************
*** 448,453 ****
--- 448,474 ----
    call delete('XTest_statusline')
  endfunc
  
+ func Test_statusline_using_mode()
+   CheckScreendump
+ 
+   let lines =<< trim END
+     set laststatus=2
+     let &statusline = '-%{mode()}-'
+   END
+   call writefile(lines, 'XTest_statusline')
+ 
+   let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 5, 'cols': 50})
+   call VerifyScreenDump(buf, 'Test_statusline_mode_1', {})
+ 
+   call term_sendkeys(buf, ":")
+   call VerifyScreenDump(buf, 'Test_statusline_mode_2', {})
+ 
+   " clean up
+   call term_sendkeys(buf, "\<CR>")
+   call StopVimInTerminal(buf)
+   call delete('XTest_statusline')
+ endfunc
+ 
  func Test_statusline_after_split_vsplit()
    only
  
*** ../vim-8.2.2685/src/testdir/dumps/Test_statusline_mode_1.dump       
2021-04-01 18:46:43.158101108 +0200
--- src/testdir/dumps/Test_statusline_mode_1.dump       2021-04-01 
18:44:58.310215618 +0200
***************
*** 0 ****
--- 1,5 ----
+ > +0&#ffffff0@49
+ |~+0#4040ff13&| @48
+ |~| @48
+ |-+3#0000000&|n|-| @46
+ | +0&&@49
*** ../vim-8.2.2685/src/testdir/dumps/Test_statusline_mode_2.dump       
2021-04-01 18:46:43.162101103 +0200
--- src/testdir/dumps/Test_statusline_mode_2.dump       2021-04-01 
18:44:59.354214638 +0200
***************
*** 0 ****
--- 1,5 ----
+ | +0&#ffffff0@49
+ |~+0#4040ff13&| @48
+ |~| @48
+ |-+3#0000000&|c|-| @46
+ |:+0&&> @48
*** ../vim-8.2.2685/src/version.c       2021-04-01 16:15:59.184829183 +0200
--- src/version.c       2021-04-01 18:43:35.802281627 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2686,
  /**/

-- 
A fine is a tax for doing wrong.  A tax is a fine for doing well.

 /// 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/202104011648.131Gm6Ho1999679%40masaka.moolenaar.net.

Raspunde prin e-mail lui