comparison src/testdir/test_vartabs.vim @ 14198:9ca8c36869ce v8.1.0116

patch 8.1.0116: display problem with 'vartabstop' and 'linebreak' commit https://github.com/vim/vim/commit/a87b72cc316e065d66dcbcf7ec1cde330adef3a3 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 25 21:24:51 2018 +0200 patch 8.1.0116: display problem with 'vartabstop' and 'linebreak' Problem: Display problem with 'vartabstop' and 'linebreak'. (Chauca Fuentes) Solution: Call tabstop_padding(). (Christian Brabandt, closes #3076)
author Christian Brabandt <cb@256bit.org>
date Mon, 25 Jun 2018 21:30:06 +0200
parents 2ad722003b36
children 539b070778b0
comparison
equal deleted inserted replaced
14197:02f2efe56793 14198:9ca8c36869ce
1 " Test for variable tabstops 1 " Test for variable tabstops
2 2
3 if !has("vartabs") 3 if !has("vartabs")
4 finish 4 finish
5 endif 5 endif
6
7 source view_util.vim
8 function! s:compare_lines(expect, actual)
9 call assert_equal(join(a:expect, "\n"), join(a:actual, "\n"))
10 endfunction
6 11
7 func! Test_vartabs() 12 func! Test_vartabs()
8 new 13 new
9 %d 14 %d
10 15
253 call assert_equal(&vsts, '12') 258 call assert_equal(&vsts, '12')
254 bwipeout! 259 bwipeout!
255 260
256 bwipeout! 261 bwipeout!
257 endfunc 262 endfunc
263
264 func! Test_vartabs_linebreak()
265 if winwidth(0) < 80
266 return
267 endif
268 new
269 70vnew
270 %d
271 setl linebreak vartabstop=10,15,20,40
272 call setline(1, "\tx\tx\tx\tx")
273
274 let lines = ScreenLines([1, 2], winwidth(0))
275 let expect = [' x x x ',
276 \ ' x ']
277 call s:compare_lines(expect, lines)
278
279 " cleanup
280 bw!
281 bw!
282 endfunc