aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-11-24 10:59:15 +0100
committerJustin M. Keyes <justinkz@gmail.com>2020-02-21 14:14:15 -0800
commit92e80f18a866ac7edc19552d20cf2f824ba31352 (patch)
treee959efd993e521336bb7b57a79662eed7cd19176 /src/nvim/testdir
parent5d41bfccec867e34ca4ae19e0f6a4c8868a755ea (diff)
downloadrneovim-92e80f18a866ac7edc19552d20cf2f824ba31352.tar.gz
rneovim-92e80f18a866ac7edc19552d20cf2f824ba31352.tar.bz2
rneovim-92e80f18a866ac7edc19552d20cf2f824ba31352.zip
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_display.vim56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_display.vim b/src/nvim/testdir/test_display.vim
index 5feb59eef1..1c2f5a05ff 100644
--- a/src/nvim/testdir/test_display.vim
+++ b/src/nvim/testdir/test_display.vim
@@ -69,3 +69,59 @@ func! Test_display_foldtext_mbyte()
set foldtext& fillchars& foldmethod& fdc&
bw!
endfunc
+
+func Test_display_listchars_precedes()
+ set fillchars+=vert:\|
+ 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 = [
+ \ "<aaa aa $ |",
+ \ "< |",
+ \ "< |",
+ \ "~ |",
+ \ ]
+ call assert_equal(expect, lines)
+ set wrap
+ call cursor(1, 1)
+ " the complete line should be displayed in the window
+ norm! $
+
+ let lines = ScreenLines([1,10], winwidth(0)+1)
+ let expect = [
+ \ "<aaa aaa a|",
+ \ "a aaa aaa |",
+ \ "aa aaa aaa|",
+ \ " aa aaa aa|",
+ \ "a aa aaa a|",
+ \ "aa aa aaa |",
+ \ "aaa aa aaa|",
+ \ " aaa aa aa|",
+ \ "a aaa aa a|",
+ \ "aa aaa aa |",
+ \ ]
+ call assert_equal(expect, lines)
+ set list& listchars& wrap&
+ bw!
+endfunc