Skip to content

Commit 536b8d0

Browse files
committed
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'.
1 parent 5f35308 commit 536b8d0

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

src/screen.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,6 +2997,14 @@ win_line(wp, lnum, startrow, endrow, nochange)
29972997
int vcol_off = 0; /* offset for concealed characters */
29982998
int did_wcol = FALSE;
29992999
# define VCOL_HLC (vcol - vcol_off)
3000+
# define FIX_FOR_BOGUSCOLS \
3001+
{ \
3002+
n_extra += vcol_off; \
3003+
vcol -= vcol_off; \
3004+
vcol_off = 0; \
3005+
col -= boguscols; \
3006+
boguscols = 0; \
3007+
}
30003008
#else
30013009
# define VCOL_HLC (vcol)
30023010
#endif
@@ -4404,7 +4412,14 @@ win_line(wp, lnum, startrow, endrow, nochange)
44044412
1), (colnr_T)vcol, NULL) - 1;
44054413
c_extra = ' ';
44064414
if (vim_iswhite(c))
4415+
{
4416+
#ifdef FEAT_CONCEAL
4417+
if (c == TAB)
4418+
/* See "Tab alignment" below. */
4419+
FIX_FOR_BOGUSCOLS;
4420+
#endif
44074421
c = ' ';
4422+
}
44084423
}
44094424
#endif
44104425

@@ -4453,11 +4468,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
44534468
* and boguscols accumulated so far in the line. Note that
44544469
* the tab can be longer than 'tabstop' when there
44554470
* are concealed characters. */
4456-
n_extra += vcol_off;
4457-
vcol -= vcol_off;
4458-
vcol_off = 0;
4459-
col -= boguscols;
4460-
boguscols = 0;
4471+
FIX_FOR_BOGUSCOLS;
44614472
#endif
44624473
#ifdef FEAT_MBYTE
44634474
mb_utf8 = FALSE; /* don't draw as UTF-8 */

src/testdir/test88.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ GGk
6868
GGk
6969
:normal $
7070
GGk
71+
:set lbr
72+
:normal $
73+
GGk
7174
:" Display result.
7275
:call append('$', 'end:')
7376
:call append('$', positions)

src/testdir/test88.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ end:
2121
9:17
2222
9:25
2323
9:26
24+
9:26

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ static char *(features[]) =
727727

728728
static int included_patches[] =
729729
{ /* Add new patch number below this line */
730+
/**/
731+
13,
730732
/**/
731733
12,
732734
/**/

0 commit comments

Comments
 (0)