Patch 8.2.2686

7 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 1, 2021, 12:48:14 PM4/1/21
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages