Mercurial > vim
comparison src/testdir/test_display.vim @ 18131:851a014dfd8b v8.1.2060
patch 8.1.2060: "precedes" in 'listchars' not used properly
Commit: https://github.com/vim/vim/commit/bffba7f7042f6082e75b42484b15f66087b01941
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 20 17:00:17 2019 +0200
patch 8.1.2060: "precedes" in 'listchars' not used properly
Problem: "precedes" in 'listchars' not used properly.
Solution: Correctly handle the "precedes" char in list mode for long lines.
(Christian Brabandt, closes #4953)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 20 Sep 2019 17:15:04 +0200 |
parents | 9695e9fed059 |
children | 956a9bc4e25a |
comparison
equal
deleted
inserted
replaced
18130:1e5672da6a69 | 18131:851a014dfd8b |
---|---|
101 | 101 |
102 " clean up | 102 " clean up |
103 call StopVimInTerminal(buf) | 103 call StopVimInTerminal(buf) |
104 call delete('Xtestscroll') | 104 call delete('Xtestscroll') |
105 endfunc | 105 endfunc |
106 | |
107 func Test_display_listchars_precedes() | |
108 call NewWindow(10, 10) | |
109 " Need a physical line that wraps over the complete | |
110 " window size | |
111 call append(0, repeat('aaa aaa aa ', 10)) | |
112 call append(1, repeat(['bbb bbb bbb bbb'], 2)) | |
113 " remove blank trailing line | |
114 $d | |
115 set list nowrap | |
116 call cursor(1, 1) | |
117 " move to end of line and scroll 2 characters back | |
118 norm! $2zh | |
119 let lines=ScreenLines([1,4], winwidth(0)+1) | |
120 let expect = [ | |
121 \ " aaa aa $ |", | |
122 \ "$ |", | |
123 \ "$ |", | |
124 \ "~ |", | |
125 \ ] | |
126 call assert_equal(expect, lines) | |
127 set list listchars+=precedes:< nowrap | |
128 call cursor(1, 1) | |
129 " move to end of line and scroll 2 characters back | |
130 norm! $2zh | |
131 let lines = ScreenLines([1,4], winwidth(0)+1) | |
132 let expect = [ | |
133 \ "<aaa aa $ |", | |
134 \ "< |", | |
135 \ "< |", | |
136 \ "~ |", | |
137 \ ] | |
138 call assert_equal(expect, lines) | |
139 set wrap | |
140 call cursor(1, 1) | |
141 " the complete line should be displayed in the window | |
142 norm! $ | |
143 | |
144 let lines = ScreenLines([1,10], winwidth(0)+1) | |
145 let expect = [ | |
146 \ "<aaa aaa a|", | |
147 \ "a aaa aaa |", | |
148 \ "aa aaa aaa|", | |
149 \ " aa aaa aa|", | |
150 \ "a aa aaa a|", | |
151 \ "aa aa aaa |", | |
152 \ "aaa aa aaa|", | |
153 \ " aaa aa aa|", | |
154 \ "a aaa aa a|", | |
155 \ "aa aaa aa |", | |
156 \ ] | |
157 call assert_equal(expect, lines) | |
158 set list& listchars& wrap& | |
159 bw! | |
160 endfunc |