diff options
-rw-r--r-- | src/nvim/screen.c | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test_listchars.vim | 19 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index aa8fbb89c6..2709ba83f3 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3995,8 +3995,10 @@ win_line ( break; } - // line continues beyond line end - if (wp->w_p_lcs_chars.ext + // Show "extends" character from 'listchars' if beyond the line end and + // 'list' is set. + if (wp->w_p_lcs_chars.ext != NUL + && wp->w_p_list && !wp->w_p_wrap && filler_todo <= 0 && (wp->w_p_rl ? col == 0 : col == grid->Columns - 1) diff --git a/src/nvim/testdir/test_listchars.vim b/src/nvim/testdir/test_listchars.vim index 2870f2d4ef..57cfaa298e 100644 --- a/src/nvim/testdir/test_listchars.vim +++ b/src/nvim/testdir/test_listchars.vim @@ -110,6 +110,25 @@ func Test_listchars() call cursor(1, 1) call assert_equal([expected], ScreenLines(1, virtcol('$'))) + " test extends + normal ggdG + set listchars=extends:Z + set nowrap + set nolist + call append(0, [ repeat('A', &columns + 1) ]) + + let expected = repeat('A', &columns) + + redraw! + call cursor(1, 1) + call assert_equal([expected], ScreenLines(1, &columns)) + + set list + let expected = expected[:-2] . 'Z' + redraw! + call cursor(1, 1) + call assert_equal([expected], ScreenLines(1, &columns)) + enew! set listchars& ff& endfunc |