aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-09 06:34:34 +0800
committerGitHub <noreply@github.com>2023-11-09 06:34:34 +0800
commitf7b2ea59a633309aba1ca5286e33d789a45cb13f (patch)
treeaa88186c94afd06a0b931f11ca5084a34dc03bef /test/old/testdir
parent3128cff6b198daabfddeedd382c0b8707319504f (diff)
downloadrneovim-f7b2ea59a633309aba1ca5286e33d789a45cb13f.tar.gz
rneovim-f7b2ea59a633309aba1ca5286e33d789a45cb13f.tar.bz2
rneovim-f7b2ea59a633309aba1ca5286e33d789a45cb13f.zip
vim-patch:9.0.2095: statusline may look different than expected (#25941)
Problem: statusline may look different than expected Solution: do not check for highlighting of stl and stlnc characters statusline fillchar may be different than expected If the highlighting group for the statusline for the current window |hl-StatusLine| or the non-current window |hl-StatusLineNC| are cleared (or do not differ from each other), than Vim will use the hard-coded fallback values '^' (for the non-current windows) or '=' (for the current window). I believe this was done, to make sure the statusline will always be visible and be distinguishable from the rest of the window. However, this may be unexpected, if a user explicitly defined those fillchar characters just to notice that those values are then not used by Vim. So, let's assume users know what they are doing and just always return the configured stl and stlnc values. And if they want the statusline to be non-distinguishable from the rest of the window space, so be it. It is their responsibility and Vim shall not know better what to use. fixes: vim/vim#13366 closes: vim/vim#13488 https://github.com/vim/vim/commit/6a650bf696f1df3214b3d788947447c5bbf1a77d Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'test/old/testdir')
-rw-r--r--test/old/testdir/test_modeline.vim2
-rw-r--r--test/old/testdir/test_statusline.vim21
2 files changed, 23 insertions, 0 deletions
diff --git a/test/old/testdir/test_modeline.vim b/test/old/testdir/test_modeline.vim
index 613722fdbd..487a89e038 100644
--- a/test/old/testdir/test_modeline.vim
+++ b/test/old/testdir/test_modeline.vim
@@ -172,6 +172,8 @@ func Test_modeline_colon()
endfunc
func s:modeline_fails(what, text, error)
+ " Don't use CheckOption(), it would skip the whole test
+ " just for a single un-supported option
if !exists('+' .. a:what)
return
endif
diff --git a/test/old/testdir/test_statusline.vim b/test/old/testdir/test_statusline.vim
index fccfd46966..c48bac12b4 100644
--- a/test/old/testdir/test_statusline.vim
+++ b/test/old/testdir/test_statusline.vim
@@ -617,4 +617,25 @@ func Test_statusline_showcmd()
call StopVimInTerminal(buf)
endfunc
+func Test_statusline_highlight_group_cleared()
+ CheckScreendump
+
+ " the laststatus option is there to prevent
+ " the code-style test from complaining about
+ " trailing whitespace
+ let lines =<< trim END
+ set fillchars=stl:\ ,stlnc:\ laststatus=2
+ split
+ hi clear StatusLine
+ hi clear StatusLineNC
+ END
+ call writefile(lines, 'XTest_statusline_stl', 'D')
+
+ let buf = RunVimInTerminal('-S XTest_statusline_stl', {})
+
+ call VerifyScreenDump(buf, 'Test_statusline_stl_1', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab