summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0116
blob: c1fdabebf4426ec499ee75cae84e0a6bc3e5db8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0116
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0116
Problem:    Display problem with 'vartabstop' and 'linebreak'. (Chauca
            Fuentes)
Solution:   Call tabstop_padding(). (Christian Brabandt, closes #3076)
Files:	    src/screen.c, src/testdir/test_vartabs.vim


*** ../vim-8.1.0115/src/screen.c	2018-06-24 19:23:59.989047923 +0200
--- src/screen.c	2018-06-25 21:21:42.002042548 +0200
***************
*** 4753,4760 ****
--- 4753,4765 ----
  		    n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
  								    NULL) - 1;
  		    if (c == TAB && n_extra + col > wp->w_width)
+ #ifdef FEAT_VARTABS
+ 			n_extra = tabstop_padding(vcol, wp->w_buffer->b_p_ts,
+ 					wp->w_buffer->b_p_vts_array) - 1;
+ #else
  			n_extra = (int)wp->w_buffer->b_p_ts
  				       - vcol % (int)wp->w_buffer->b_p_ts - 1;
+  #endif
  
  # ifdef FEAT_MBYTE
  		    c_extra = mb_off > 0 ? MB_FILLER_CHAR : ' ';
*** ../vim-8.1.0115/src/testdir/test_vartabs.vim	2018-06-23 19:22:45.618486231 +0200
--- src/testdir/test_vartabs.vim	2018-06-25 21:22:50.237671137 +0200
***************
*** 4,9 ****
--- 4,14 ----
    finish
  endif
  
+ source view_util.vim
+ function! s:compare_lines(expect, actual)
+   call assert_equal(join(a:expect, "\n"), join(a:actual, "\n"))
+ endfunction
+ 
  func! Test_vartabs()
    new
    %d
***************
*** 255,257 ****
--- 260,282 ----
  
    bwipeout!
  endfunc
+ 
+ func! Test_vartabs_linebreak()
+   if winwidth(0) < 80
+     return
+   endif
+   new
+   70vnew
+   %d
+   setl linebreak vartabstop=10,15,20,40
+   call setline(1, "\tx\tx\tx\tx")
+ 
+   let lines = ScreenLines([1, 2], winwidth(0))
+   let expect = ['          x              x                   x                        ',
+         \       '               x                                                      ']
+   call s:compare_lines(expect, lines)
+ 
+   " cleanup
+   bw!
+   bw!
+ endfunc
*** ../vim-8.1.0115/src/version.c	2018-06-25 00:05:55.901799630 +0200
--- src/version.c	2018-06-25 21:24:22.389089360 +0200
***************
*** 791,792 ****
--- 791,794 ----
  {   /* Add new patch number below this line */
+ /**/
+     116,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
115. You are late picking up your kid from school and try to explain
     to the teacher you were stuck in Web traffic.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///