From 16549324988be0717b59f7e5fec818ee9ad70f52 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 21 Sep 2019 20:29:15 -0700 Subject: vim-patch:8.1.2060: "precedes" in 'listchars' not used properly (Credit: Zach Wegner, https://github.com/neovim/neovim/pull/11034) Problem: "precedes" in 'listchars' not used properly. Solution: Correctly handle the "precedes" char in list mode for long lines. https://github.com/vim/vim/commit/bffba7f7042f6082e75b42484b15f66087b01941 --- src/nvim/testdir/test_display.vim | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'src/nvim/testdir/test_display.vim') diff --git a/src/nvim/testdir/test_display.vim b/src/nvim/testdir/test_display.vim index 5feb59eef1..66c13ded82 100644 --- a/src/nvim/testdir/test_display.vim +++ b/src/nvim/testdir/test_display.vim @@ -69,3 +69,58 @@ func! Test_display_foldtext_mbyte() set foldtext& fillchars& foldmethod& fdc& bw! endfunc + +func Test_display_listchars_precedes() + call NewWindow(10, 10) + " Need a physical line that wraps over the complete + " window size + call append(0, repeat('aaa aaa aa ', 10)) + call append(1, repeat(['bbb bbb bbb bbb'], 2)) + " remove blank trailing line + $d + set list nowrap + call cursor(1, 1) + " move to end of line and scroll 2 characters back + norm! $2zh + let lines=ScreenLines([1,4], winwidth(0)+1) + let expect = [ + \ " aaa aa $ |", + \ "$ |", + \ "$ |", + \ "~ |", + \ ] + call assert_equal(expect, lines) + set list listchars+=precedes:< nowrap + call cursor(1, 1) + " move to end of line and scroll 2 characters back + norm! $2zh + let lines = ScreenLines([1,4], winwidth(0)+1) + let expect = [ + \ " Date: Sun, 24 Nov 2019 10:59:15 +0100 Subject: options: make 'fillchars' and 'listchars' global-local These options were previously global. A global-local window option behaves closer to a global option "per default" (i e with :set), but still supports local behavior via :setl Also this restores back-compat for nvim_set_option("fcs", ...) which are currently broken on 0.4.x but worked in earlier versions --- src/nvim/testdir/test_display.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/testdir/test_display.vim') diff --git a/src/nvim/testdir/test_display.vim b/src/nvim/testdir/test_display.vim index 66c13ded82..1c2f5a05ff 100644 --- a/src/nvim/testdir/test_display.vim +++ b/src/nvim/testdir/test_display.vim @@ -71,6 +71,7 @@ func! Test_display_foldtext_mbyte() endfunc func Test_display_listchars_precedes() + set fillchars+=vert:\| call NewWindow(10, 10) " Need a physical line that wraps over the complete " window size -- cgit