Skip to content

Commit 7e4f62a

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.0.2189: Wrong display with 'briopt=sbr' and 'nobreakindent'
Problem: Wrong display when 'breakindentopt' contains "sbr" and 'showbreak' and 'nobreakindent' are set. Solution: Always reset wlv->need_showbreak regardless of the values of 'breakindent' and 'showbreak', as they aren't checked when setting wlv->need_showbreak (zeertzjq) closes: #13785 Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 715a805 commit 7e4f62a

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/drawline.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,6 @@ handle_breakindent(win_T *wp, winlinevars_T *wlv)
524524
if (wlv->n_extra < 0)
525525
wlv->n_extra = 0;
526526
}
527-
if (wp->w_skipcol > 0 && wlv->startrow == 0
528-
&& wp->w_p_wrap && wp->w_briopt_sbr)
529-
wlv->need_showbreak = FALSE;
530527

531528
// Correct start of highlighted area for 'breakindent',
532529
if (wlv->fromcol >= wlv->vcol
@@ -538,6 +535,10 @@ handle_breakindent(win_T *wp, winlinevars_T *wlv)
538535
if (wlv->tocol == wlv->vcol)
539536
wlv->tocol += wlv->n_extra;
540537
}
538+
539+
if (wp->w_skipcol > 0 && wlv->startrow == 0 && wp->w_p_wrap
540+
&& wp->w_briopt_sbr)
541+
wlv->need_showbreak = FALSE;
541542
}
542543
}
543544
#endif
@@ -579,8 +580,6 @@ handle_showbreak_and_filler(win_T *wp, winlinevars_T *wlv)
579580
wlv->c_extra = NUL;
580581
wlv->c_final = NUL;
581582
wlv->n_extra = (int)STRLEN(sbr);
582-
if (wp->w_skipcol == 0 || wlv->startrow != 0 || !wp->w_p_wrap)
583-
wlv->need_showbreak = FALSE;
584583
wlv->vcol_sbr = wlv->vcol + MB_CHARLEN(sbr);
585584

586585
// Correct start of highlighted area for 'showbreak'.
@@ -599,6 +598,10 @@ handle_showbreak_and_filler(win_T *wp, winlinevars_T *wlv)
599598
wlv->char_attr = hl_combine_attr(wlv->char_attr, wlv->cul_attr);
600599
# endif
601600
}
601+
602+
if (wp->w_skipcol == 0 || wlv->startrow > 0 || !wp->w_p_wrap
603+
|| !wp->w_briopt_sbr)
604+
wlv->need_showbreak = FALSE;
602605
# endif
603606
}
604607
#endif

src/testdir/dumps/Test_visual_starts_before_skipcol_4.dump

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
|++0#4040ff13#ffffff0@8>+@65
2-
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|2|9|1|-|3|1|0| @5|A|l@1
1+
|++0#4040ff13#ffffff0@2| +0#0000000#e0e0e08|9|8| |9@1> +0&#ffffff0@65
2+
|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|2|9|1|-|3|1|0| @5|A|l@1
33
| +0&&@74
44
|~+0#4040ff13&| @73
55
|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1

src/version.c

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

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
2189,
707709
/**/
708710
2188,
709711
/**/

0 commit comments

Comments
 (0)