neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit aecbc3f832a20f860858c3b2a9774c6a51fd52da
parent 31d7007bf745d3f03902b27c2124d473ec2f8906
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Fri, 29 Dec 2023 06:44:14 +0800

vim-patch:9.0.2189: Wrong display with 'briopt=sbr' and 'nobreakindent' (#26785)

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: vim/vim#13785

https://github.com/vim/vim/commit/7e4f62a2575e8ce9ebb842d4246288138b11dff3
Diffstat:
Msrc/nvim/drawline.c | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c @@ -716,10 +716,10 @@ static void handle_breakindent(win_T *wp, winlinevars_T *wlv) if (wlv->tocol == vcol_before) { wlv->tocol = wlv->vcol; } + } - if (wp->w_skipcol > 0 && wlv->startrow == 0 && wp->w_p_wrap && wp->w_briopt_sbr) { - wlv->need_showbreak = false; - } + if (wp->w_skipcol > 0 && wlv->startrow == 0 && wp->w_p_wrap && wp->w_briopt_sbr) { + wlv->need_showbreak = false; } } @@ -739,9 +739,6 @@ static void handle_showbreak_and_filler(win_T *wp, winlinevars_T *wlv) char *const sbr = get_showbreak_value(wp); if (*sbr != NUL && wlv->need_showbreak) { // Draw 'showbreak' at the start of each broken line. - if (wp->w_skipcol == 0 || wlv->startrow != 0 || !wp->w_p_wrap) { - wlv->need_showbreak = false; - } // Combine 'showbreak' with 'cursorline', prioritizing 'showbreak'. int attr = hl_combine_attr(wlv->cul_attr, win_hl_attr(wp, HLF_AT)); colnr_T vcol_before = wlv->vcol; @@ -759,6 +756,10 @@ static void handle_showbreak_and_filler(win_T *wp, winlinevars_T *wlv) wlv->tocol = wlv->vcol; } } + + if (wp->w_skipcol == 0 || wlv->startrow > 0 || !wp->w_p_wrap || !wp->w_briopt_sbr) { + wlv->need_showbreak = false; + } } static void apply_cursorline_highlight(win_T *wp, winlinevars_T *wlv)