0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.4a.013

Problem:    Setting/resetting 'lbr' in the main help file changes alignment
            after a Tab. (Dimitar Dimitrov)
Solution:   Also use the code for conceal mode where n_extra is computed for
            'lbr'.
This commit is contained in:
Bram Moolenaar 2013-07-13 12:36:55 +02:00
parent fba2424cf2
commit 3ff9b185fe
4 changed files with 22 additions and 5 deletions

View File

@ -2997,6 +2997,14 @@ win_line(wp, lnum, startrow, endrow, nochange)
int vcol_off = 0; /* offset for concealed characters */ int vcol_off = 0; /* offset for concealed characters */
int did_wcol = FALSE; int did_wcol = FALSE;
# define VCOL_HLC (vcol - vcol_off) # define VCOL_HLC (vcol - vcol_off)
# define FIX_FOR_BOGUSCOLS \
{ \
n_extra += vcol_off; \
vcol -= vcol_off; \
vcol_off = 0; \
col -= boguscols; \
boguscols = 0; \
}
#else #else
# define VCOL_HLC (vcol) # define VCOL_HLC (vcol)
#endif #endif
@ -4404,7 +4412,14 @@ win_line(wp, lnum, startrow, endrow, nochange)
1), (colnr_T)vcol, NULL) - 1; 1), (colnr_T)vcol, NULL) - 1;
c_extra = ' '; c_extra = ' ';
if (vim_iswhite(c)) if (vim_iswhite(c))
{
#ifdef FEAT_CONCEAL
if (c == TAB)
/* See "Tab alignment" below. */
FIX_FOR_BOGUSCOLS;
#endif
c = ' '; c = ' ';
}
} }
#endif #endif
@ -4453,11 +4468,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
* and boguscols accumulated so far in the line. Note that * and boguscols accumulated so far in the line. Note that
* the tab can be longer than 'tabstop' when there * the tab can be longer than 'tabstop' when there
* are concealed characters. */ * are concealed characters. */
n_extra += vcol_off; FIX_FOR_BOGUSCOLS;
vcol -= vcol_off;
vcol_off = 0;
col -= boguscols;
boguscols = 0;
#endif #endif
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
mb_utf8 = FALSE; /* don't draw as UTF-8 */ mb_utf8 = FALSE; /* don't draw as UTF-8 */

View File

@ -68,6 +68,9 @@ GGk
GGk GGk
:normal $ :normal $
GGk GGk
:set lbr
:normal $
GGk
:" Display result. :" Display result.
:call append('$', 'end:') :call append('$', 'end:')
:call append('$', positions) :call append('$', positions)

View File

@ -21,3 +21,4 @@ end:
9:17 9:17
9:25 9:25
9:26 9:26
9:26

View File

@ -727,6 +727,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 */
/**/
13,
/**/ /**/
12, 12,
/**/ /**/