vim-patch:7.4.416

Problem:    Problem with breakindent/showbreak and tabs.
Solution:   Handle tabs differently. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?name=v7-4-416
This commit is contained in:
Scott Prager 2014-10-11 19:13:35 -04:00
parent b1e06c6d60
commit 24ebb018e2
4 changed files with 22 additions and 7 deletions

View File

@ -1072,12 +1072,7 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he
if (wp->w_p_bri)
added += get_breakindent_win(wp, line);
if (tab_corr) {
size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts;
} else {
size += added;
}
if (col != 0) {
added = 0;
}

View File

@ -73,6 +73,23 @@ STARTTEST
:let width = strlen(text[1:])+indent(2)*4+strlen(&sbr)*3 " text wraps 3 times
:$put =g:test
:$put =printf(\"strdisplaywidth: %d == calculated: %d\", strdisplaywidth(text), width)
:"
:" Test, that the string " a\tb\tc\td\te" is correctly
:" displayed in a 20 column wide window (see bug report
:" https://groups.google.com/d/msg/vim_dev/ZOdg2mc9c9Y/TT8EhFjEy0IJ
:only
:vert 20new
:set all& nocp breakindent briopt=min:10
:call setline(1, [" a\tb\tc\td\te", " z y x w v"])
:/^\s*a
fbgjyl:let line1 = @0
:?^\s*z
fygjyl:let line2 = @0
:quit!
:$put ='Test 12: breakindent with wrapping Tab'
:$put =line1
:$put =line2
:"
:%w! test.out
:qa!
ENDTEST

View File

@ -53,3 +53,6 @@ Test 4: Simple breakindent + min width: 18
Test 11: strdisplaywidth when breakindent is on
strdisplaywidth: 46 == calculated: 64
Test 12: breakindent with wrapping Tab
d
w

View File

@ -249,7 +249,7 @@ static int included_patches[] = {
//419,
418,
//417,
//416,
416,
415,
414,
//413 NA