aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-12-19 09:55:17 +0800
committerzeertzjq <zeertzjq@outlook.com>2021-12-19 09:55:17 +0800
commitfd70018e21b8ce4b8c9f6074854e0174a87dfbb5 (patch)
tree5a243a2db24ba79c2940857df85811c2ec09a77e
parent95803f0e902278079e5876082465b1910c819947 (diff)
downloadrneovim-fd70018e21b8ce4b8c9f6074854e0174a87dfbb5.tar.gz
rneovim-fd70018e21b8ce4b8c9f6074854e0174a87dfbb5.tar.bz2
rneovim-fd70018e21b8ce4b8c9f6074854e0174a87dfbb5.zip
vim-patch:8.2.2508: cannot change the character displayed in non existing lines
Problem: Cannot change the character displayed in non existing lines. Solution: Add the "eob" item to 'fillchars'. (closes vim/vim#7832, closes vim/vim#3820) https://github.com/vim/vim/commit/a98f8a230596d8fb44cc68321de72980a21428cb Nvim has already implemented this feature, so this just ports the tests and docs.
-rw-r--r--runtime/doc/windows.txt10
-rw-r--r--src/nvim/testdir/test_display.vim22
2 files changed, 28 insertions, 4 deletions
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index e0c33fa2c9..bb31895c96 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -116,10 +116,12 @@ other windows. If 'mouse' is enabled, a status line can be dragged to resize
windows.
*filler-lines*
-The lines after the last buffer line in a window are called filler lines.
-These lines start with a tilde (~) character. By default, these are
-highlighted as NonText (|hl-NonText|). The EndOfBuffer highlight group
-(|hl-EndOfBuffer|) can be used to change the highlighting of filler lines.
+The lines after the last buffer line in a window are called filler lines. By
+default, these lines start with a tilde (~) character. The 'eob' item in the
+'fillchars' option can be used to change this character. By default, these
+characters are highlighted as NonText (|hl-NonText|). The EndOfBuffer
+highlight group (|hl-EndOfBuffer|) can be used to change the highlighting of
+the filler characters.
==============================================================================
3. Opening and closing a window *opening-window* *E36*
diff --git a/src/nvim/testdir/test_display.vim b/src/nvim/testdir/test_display.vim
index 12327f34d6..f8ebb31b45 100644
--- a/src/nvim/testdir/test_display.vim
+++ b/src/nvim/testdir/test_display.vim
@@ -263,6 +263,28 @@ func Test_display_scroll_at_topline()
call StopVimInTerminal(buf)
endfunc
+" Test for 'eob' (EndOfBuffer) item in 'fillchars'
+func Test_eob_fillchars()
+ " default value (skipped)
+ " call assert_match('eob:\~', &fillchars)
+ " invalid values
+ call assert_fails(':set fillchars=eob:', 'E474:')
+ call assert_fails(':set fillchars=eob:xy', 'E474:')
+ call assert_fails(':set fillchars=eob:\255', 'E474:')
+ call assert_fails(':set fillchars=eob:<ff>', 'E474:')
+ " default is ~
+ new
+ call assert_equal('~', Screenline(2))
+ set fillchars=eob:+
+ redraw!
+ call assert_equal('+', Screenline(2))
+ set fillchars=eob:\
+ redraw!
+ call assert_equal(' ', nr2char(screenchar(2, 1)))
+ set fillchars&
+ close
+endfunc
+
func Test_display_linebreak_breakat()
new
vert resize 25