0
0
mirror of https://github.com/vim/vim.git synced 2025-09-07 22:03:36 -04:00

updated for version 7.4.352

Problem:    With 'linebreak' a tab causes a missing line break.
Solution:   Count a tab for what it's worth also for shorter lines.
            (Christian Brabandt)
This commit is contained in:
Bram Moolenaar 2014-07-02 19:37:42 +02:00
parent c35e3de8cc
commit ee739b42c0
2 changed files with 10 additions and 4 deletions

View File

@ -1078,6 +1078,7 @@ win_lbr_chartabsize(wp, line, s, col, headp)
int c; int c;
int size; int size;
colnr_T col2; colnr_T col2;
colnr_T col_adj = 0; /* col + screen size of tab */
colnr_T colmax; colnr_T colmax;
int added; int added;
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
@ -1109,6 +1110,8 @@ win_lbr_chartabsize(wp, line, s, col, headp)
*/ */
size = win_chartabsize(wp, s, col); size = win_chartabsize(wp, s, col);
c = *s; c = *s;
if (tab_corr)
col_adj = size - 1;
/* /*
* If 'linebreak' set check at a blank before a non-blank if the line * If 'linebreak' set check at a blank before a non-blank if the line
@ -1130,12 +1133,13 @@ win_lbr_chartabsize(wp, line, s, col, headp)
*/ */
numberextra = win_col_off(wp); numberextra = win_col_off(wp);
col2 = col; col2 = col;
colmax = (colnr_T)(W_WIDTH(wp) - numberextra); colmax = (colnr_T)(W_WIDTH(wp) - numberextra - col_adj);
if (col >= colmax) if (col >= colmax)
{ {
n = colmax + win_col_off2(wp); colmax += col_adj;
n = colmax + win_col_off2(wp);
if (n > 0) if (n > 0)
colmax += (((col - colmax) / n) + 1) * n; colmax += (((col - colmax) / n) + 1) * n - col_adj;
} }
for (;;) for (;;)
@ -1152,7 +1156,7 @@ win_lbr_chartabsize(wp, line, s, col, headp)
col2 += win_chartabsize(wp, s, col2); col2 += win_chartabsize(wp, s, col2);
if (col2 >= colmax) /* doesn't fit */ if (col2 >= colmax) /* doesn't fit */
{ {
size = colmax - col; size = colmax - col + col_adj;
tab_corr = FALSE; tab_corr = FALSE;
break; break;
} }

View File

@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
352,
/**/ /**/
351, 351,
/**/ /**/