diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-08 20:20:46 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-08 20:20:46 +0200 |
commit | a5c6a0b6c71ae11078cbf6f5e18ce49a0468a117 (patch) | |
tree | d74ac4cf3dc46facf20a0f24caa4611caa285469 | |
parent | 5416b75031138182387399f8fe5e17a884414e1a (diff) | |
download | vim-git-a5c6a0b6c71ae11078cbf6f5e18ce49a0468a117.tar.gz |
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is offv8.1.1299
Problem: "extends" from 'listchars' is used when 'list' is off. (Hiroyuki
Yoshinaga)
Solution: Only use the "extends" character when 'list' is on. (Hirohito
Higashi, closes #4360)
-rw-r--r-- | src/screen.c | 6 | ||||
-rw-r--r-- | src/testdir/test_listchars.vim | 19 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c index eb81bee84..e56d2bc01 100644 --- a/src/screen.c +++ b/src/screen.c @@ -5594,8 +5594,10 @@ win_line( break; } - /* line continues beyond line end */ - if (lcs_ext + // Show "extends" character from 'listchars' if beyond the line end and + // 'list' is set. + if (lcs_ext != NUL + && wp->w_p_list && !wp->w_p_wrap #ifdef FEAT_DIFF && filler_todo <= 0 diff --git a/src/testdir/test_listchars.vim b/src/testdir/test_listchars.vim index 3eef75d28..5df501039 100644 --- a/src/testdir/test_listchars.vim +++ b/src/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 diff --git a/src/version.c b/src/version.c index 90f9e87bf..1ea47db72 100644 --- a/src/version.c +++ b/src/version.c @@ -768,6 +768,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1299, +/**/ 1298, /**/ 1297, |