Mercurial > vim
comparison src/testdir/test_vartabs.vim @ 14218:539b070778b0 v8.1.0126
patch 8.1.0126: various problems with 'vartabstop'
commit https://github.com/vim/vim/commit/307ac5c68e9e624ab713136d79f35bb73f780d2d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 28 22:23:00 2018 +0200
patch 8.1.0126: various problems with 'vartabstop'
Problem: Various problems with 'vartabstop'.
Solution: Fix memory leak. Fix crash. Add a few more tests. (Christian
Brabandt, closes #3076)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 28 Jun 2018 22:30:06 +0200 |
parents | 9ca8c36869ce |
children | dc54785f9a1d |
comparison
equal
deleted
inserted
replaced
14217:30af25836c8d | 14218:539b070778b0 |
---|---|
260 | 260 |
261 bwipeout! | 261 bwipeout! |
262 endfunc | 262 endfunc |
263 | 263 |
264 func! Test_vartabs_linebreak() | 264 func! Test_vartabs_linebreak() |
265 if winwidth(0) < 80 | 265 if winwidth(0) < 40 |
266 return | 266 return |
267 endif | 267 endif |
268 new | 268 new |
269 70vnew | 269 40vnew |
270 %d | 270 %d |
271 setl linebreak vartabstop=10,15,20,40 | 271 setl linebreak vartabstop=10,20,30,40 |
272 call setline(1, "\tx\tx\tx\tx") | 272 call setline(1, "\tx\tx\tx\tx") |
273 | 273 |
274 let lines = ScreenLines([1, 2], winwidth(0)) | 274 let expect = [' x ', |
275 let expect = [' x x x ', | 275 \ 'x x ', |
276 \ ' x '] | 276 \ 'x '] |
277 let lines = ScreenLines([1, 3], winwidth(0)) | |
278 call s:compare_lines(expect, lines) | |
279 setl list listchars=tab:>- | |
280 let expect = ['>---------x>------------------ ', | |
281 \ 'x>------------------x>------------------', | |
282 \ 'x '] | |
283 let lines = ScreenLines([1, 3], winwidth(0)) | |
284 call s:compare_lines(expect, lines) | |
285 setl linebreak vartabstop=40 | |
286 let expect = ['>---------------------------------------', | |
287 \ 'x>--------------------------------------', | |
288 \ 'x>--------------------------------------', | |
289 \ 'x>--------------------------------------', | |
290 \ 'x '] | |
291 let lines = ScreenLines([1, 5], winwidth(0)) | |
277 call s:compare_lines(expect, lines) | 292 call s:compare_lines(expect, lines) |
278 | 293 |
279 " cleanup | 294 " cleanup |
280 bw! | 295 bw! |
281 bw! | 296 bw! |
297 set nolist listchars&vim | |
282 endfunc | 298 endfunc |