aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-29 06:44:14 +0800
committerGitHub <noreply@github.com>2023-12-29 06:44:14 +0800
commitaecbc3f832a20f860858c3b2a9774c6a51fd52da (patch)
treeb41eb5d5fd444d65f502fd795bfdc639fe43ba3e
parent31d7007bf745d3f03902b27c2124d473ec2f8906 (diff)
downloadrneovim-aecbc3f832a20f860858c3b2a9774c6a51fd52da.tar.gz
rneovim-aecbc3f832a20f860858c3b2a9774c6a51fd52da.tar.bz2
rneovim-aecbc3f832a20f860858c3b2a9774c6a51fd52da.zip
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
-rw-r--r--src/nvim/drawline.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 2a6a76d509..9478175105 100644
--- 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)