]> granicus.if.org Git - vim/commitdiff
patch 8.2.2737: status line not updated when local 'statusline' option set v8.2.2737
authorBram Moolenaar <Bram@vim.org>
Thu, 8 Apr 2021 16:27:53 +0000 (18:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 8 Apr 2021 16:27:53 +0000 (18:27 +0200)
Problem:    Status line not updated when local 'statusline' option set.
Solution:   Check the 'statusline' option of each window.

src/ex_getln.c
src/testdir/dumps/Test_statusline_mode_1.dump
src/testdir/dumps/Test_statusline_mode_2.dump
src/testdir/test_statusline.vim
src/version.c

index b61761b6088f92343512eb7b6c44f7e5f02a289c..a9f33e6ec28e04013cf38ddd64c411343104ee3f 100644 (file)
@@ -1710,10 +1710,19 @@ getcmdline_int(
 #ifdef FEAT_STL_OPT
     // Redraw the statusline in case it uses the current mode using the mode()
     // function.
-    if (!cmd_silent && msg_scrolled == 0 && *p_stl != NUL)
+    if (!cmd_silent && msg_scrolled == 0)
     {
-       curwin->w_redr_status = TRUE;
-       redraw_statuslines();
+       int     found_one = FALSE;
+       win_T   *wp;
+
+       FOR_ALL_WINDOWS(wp)
+           if (*p_stl != NUL || *wp->w_p_stl != NUL)
+           {
+               wp->w_redr_status = TRUE;
+               found_one = TRUE;
+           }
+       if (found_one)
+           redraw_statuslines();
     }
 #endif
 
index 476fb7363de8f728fbe397653c52c3be5f1ac14a..9d111c9ed4ed7c7e3c57076820159b60fd83f52b 100644 (file)
@@ -1,5 +1,7 @@
 > +0&#ffffff0@49
 |~+0#4040ff13&| @48
-|~| @48
-|-+3#0000000&|n|-| @46
+|++3#0000000&|n|+| @46
+| +0&&@49
+|~+0#4040ff13&| @48
+|-+1#0000000&|n|-| @46
 | +0&&@49
index e4fe764ad9f2c058cc57759968bd23e7e07ff215..f195543b0c63f9e649456e0d5b3358251af9d7c7 100644 (file)
@@ -1,5 +1,7 @@
 | +0&#ffffff0@49
 |~+0#4040ff13&| @48
-|~| @48
-|-+3#0000000&|c|-| @46
+|++3#0000000&|c|+| @46
+| +0&&@49
+|~+0#4040ff13&| @48
+|-+1#0000000&|c|-| @46
 |:+0&&> @48
index bbf7ddf1940febb42a86bd423452fdbba26e81bb..ca28379f5dd5c84d7978b0ff698fb227f05c3655 100644 (file)
@@ -452,19 +452,20 @@ func Test_statusline_using_mode()
   CheckScreendump
 
   let lines =<< trim END
-    set laststatus=2
-    let &statusline = '-%{mode()}-'
+    setlocal statusline=-%{mode()}-
+    split
+    setlocal statusline=+%{mode()}+
   END
   call writefile(lines, 'XTest_statusline')
 
-  let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 5, 'cols': 50})
+  let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 7, '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 term_sendkeys(buf, "close\<CR>")
   call StopVimInTerminal(buf)
   call delete('XTest_statusline')
 endfunc
index 4e6435c31db007b0235baf5148ddf7cbd5756101..1a1f23784396dba32835fb9ad66ac348238fa0fe 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2737,
 /**/
     2736,
 /**/