diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-08 18:27:53 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-08 18:27:53 +0200 |
commit | d8db8383926cb8729417d9515cbfaf455dbbd8d1 (patch) | |
tree | 5677b947d81e5a7178aed8f6ed0bf6491beaf19a | |
parent | 175a41c13f3e27e30c662f2f418c5a347dbc645d (diff) | |
download | vim-git-d8db8383926cb8729417d9515cbfaf455dbbd8d1.tar.gz |
patch 8.2.2737: status line not updated when local 'statusline' option setv8.2.2737
Problem: Status line not updated when local 'statusline' option set.
Solution: Check the 'statusline' option of each window.
-rw-r--r-- | src/ex_getln.c | 15 | ||||
-rw-r--r-- | src/testdir/dumps/Test_statusline_mode_1.dump | 6 | ||||
-rw-r--r-- | src/testdir/dumps/Test_statusline_mode_2.dump | 6 | ||||
-rw-r--r-- | src/testdir/test_statusline.vim | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
5 files changed, 27 insertions, 11 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index b61761b60..a9f33e6ec 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -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 diff --git a/src/testdir/dumps/Test_statusline_mode_1.dump b/src/testdir/dumps/Test_statusline_mode_1.dump index 476fb7363..9d111c9ed 100644 --- a/src/testdir/dumps/Test_statusline_mode_1.dump +++ b/src/testdir/dumps/Test_statusline_mode_1.dump @@ -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 diff --git a/src/testdir/dumps/Test_statusline_mode_2.dump b/src/testdir/dumps/Test_statusline_mode_2.dump index e4fe764ad..f195543b0 100644 --- a/src/testdir/dumps/Test_statusline_mode_2.dump +++ b/src/testdir/dumps/Test_statusline_mode_2.dump @@ -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 diff --git a/src/testdir/test_statusline.vim b/src/testdir/test_statusline.vim index bbf7ddf19..ca28379f5 100644 --- a/src/testdir/test_statusline.vim +++ b/src/testdir/test_statusline.vim @@ -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 diff --git a/src/version.c b/src/version.c index 4e6435c31..1a1f23784 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2737, +/**/ 2736, /**/ 2735, |