> Thank you Bram. I've got the point.
> How about this patch?
> I noticed the note in syntax.txt but still believe that the patch solves the
> strange behavior
> that most people will not configure what's going on until look into the
> source code.
>
Sorry, there's no need to add the test in Makefile because I added into
test_alot.vim. I fixed the patch.
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 2138f02..9da27a8 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -4991,8 +4991,6 @@ SpellRare Word that is recognized by the spellchecker as
one that is
StatusLine status line of current window
*hl-StatusLineNC*
StatusLineNC status lines of not-current windows
- Note: if this is equal to "StatusLine" Vim will use "^^^" in
- the status line of the current window.
*hl-TabLine*
TabLine tab pages line, not active tab page label
*hl-TabLineFill*
diff --git a/src/globals.h b/src/globals.h
index 0b6abb0..81b0177 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1190,8 +1190,8 @@ EXTERN int lcs_conceal INIT(= ' ');
#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) \
|| defined(FEAT_FOLDING)
/* Characters from 'fillchars' option */
-EXTERN int fill_stl INIT(= ' ');
-EXTERN int fill_stlnc INIT(= ' ');
+EXTERN int fill_stl INIT(= NUL);
+EXTERN int fill_stlnc INIT(= NUL);
#endif
#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
EXTERN int fill_vert INIT(= ' ');
diff --git a/src/screen.c b/src/screen.c
index ee61a01..c4ec1a9 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -10532,13 +10532,11 @@ fillchar_status(int *attr, int is_curwin)
*attr = hl_attr(HLF_SNC);
fill = fill_stlnc;
}
- /* Use fill when there is highlighting, and highlighting of current
- * window differs, or the fillchars differ, or this is not the
- * current window */
- if (*attr != 0 && ((hl_attr(HLF_S) != hl_attr(HLF_SNC)
- || !is_curwin || ONE_WINDOW)
- || (fill_stl != fill_stlnc)))
+ /* Use fill when there is highlighting */
+ if (fill != NUL && *attr != 0)
return fill;
+ if (ONE_WINDOW)
+ return ' ';
if (is_curwin)
return '^';
return '=';
diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim
index d24b97f..abee0eb 100644
--- a/src/testdir/test_alot.vim
+++ b/src/testdir/test_alot.vim
@@ -14,6 +14,7 @@ source test_expand_dllpath.vim
source test_feedkeys.vim
source test_file_perm.vim
source test_fileformat.vim
+source test_fillchars.vim
source test_filter_cmd.vim
source test_filter_map.vim
source test_fnamemodify.vim
diff --git a/src/testdir/test_fillchars.vim b/src/testdir/test_fillchars.vim
new file mode 100644
index 0000000..b8d5cde
--- /dev/null
+++ b/src/testdir/test_fillchars.vim
@@ -0,0 +1,38 @@
+function! Test_fillchars_stl_stlnc_vert()
+ set laststatus=2 statusline=\ fillchars=stl:~,stlnc:_,vert:* nosplitright
+ highlight StatusLine ctermbg=8 ctermfg=15 cterm=NONE guibg=#808080
guifg=#ffffff gui=NONE
+ highlight StatusLineNC ctermbg=8 ctermfg=7 cterm=NONE guibg=#808080
guifg=#c0c0c0 gui=NONE
+ only! | vnew
+ redrawstatus!
+ call assert_equal('~', nr2char(screenchar(winheight(0) + 1, 2)))
+ call assert_equal('_', nr2char(screenchar(winheight(0) + 1, winwidth(0) +
3)))
+ echo assert_equal('*', nr2char(screenchar(1, winwidth(0) + 1)))
+endfunction
+
+function! Test_fillchars_stl_stlnc_one_window()
+ set laststatus=2 statusline=\ fillchars=stl:~,stlnc:_ nosplitright
+ highlight StatusLine ctermbg=8 ctermfg=15 cterm=NONE guibg=#808080
guifg=#ffffff gui=NONE
+ only!
+ redrawstatus!
+ call assert_equal('~', nr2char(screenchar(winheight(0) + 1, 2)))
+endfunction
+
+function! Test_fillchars_same_stl_stlnc_same_highlight()
+ set laststatus=2 statusline=\ fillchars=stl:_,stlnc:_ nosplitright
+ highlight StatusLine ctermbg=8 ctermfg=7 cterm=NONE guibg=#808080
guifg=#c0c0c0 gui=NONE
+ highlight StatusLineNC ctermbg=8 ctermfg=7 cterm=NONE guibg=#808080
guifg=#c0c0c0 gui=NONE
+ only! | vnew
+ redrawstatus!
+ call assert_equal('_', nr2char(screenchar(winheight(0) + 1, 2)))
+ call assert_equal('_', nr2char(screenchar(winheight(0) + 1, winwidth(0) +
3)))
+endfunction
+
+function! Test_fillchars_stl_stlnc_highlights_cleared()
+ set laststatus=2 statusline=\ fillchars=stl:~,stlnc:_ nosplitright
+ highlight clear StatusLine
+ highlight clear StatusLineNC
+ only! | vnew
+ redrawstatus!
+ call assert_equal('^', nr2char(screenchar(winheight(0) + 1, 2)))
+ call assert_equal('=', nr2char(screenchar(winheight(0) + 1, winwidth(0) +
3)))
+endfunction
--
--
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].
For more options, visit https://groups.google.com/d/optout.