aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-08 21:42:00 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-08 21:46:37 -0400
commit98398ff93f239b27b5ab5eff27f49d1d5d6599ad (patch)
tree13f0554103243f36eaeaae311c25f06ce965f7aa
parent924f1173cb120b36df738e02d60c6c864ed1ffac (diff)
downloadrneovim-98398ff93f239b27b5ab5eff27f49d1d5d6599ad.tar.gz
rneovim-98398ff93f239b27b5ab5eff27f49d1d5d6599ad.tar.bz2
rneovim-98398ff93f239b27b5ab5eff27f49d1d5d6599ad.zip
vim-patch:8.1.1299: "extends" from 'listchars' is used when 'list' is off
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 vim/vim#4360) https://github.com/vim/vim/commit/a5c6a0b6c71ae11078cbf6f5e18ce49a0468a117
-rw-r--r--src/nvim/screen.c6
-rw-r--r--src/nvim/testdir/test_listchars.vim19
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