From 34a4f3729ce4a047ae945238276c8e2dabc38048 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Wed, 26 Apr 2023 19:40:22 +0200 Subject: [PATCH] vim-patch:9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo' Problem: Tests failing with 'breakindent', 'number' and "n" in 'cpo'. Solution: Do count the number column in topline if 'breakindent' is set. https://github.com/vim/vim/commit/3725116f6ec3b5c01e456b151a60c0690e04f76c Co-authored-by: Bram Moolenaar --- src/nvim/drawline.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 1e8de1bab0..0d701f07bb 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -599,10 +599,11 @@ static void handle_lnum_col(win_T *wp, winlinevars_T *wlv, int num_signs, int si if ((wp->w_p_nu || wp->w_p_rnu) && (wlv->row == wlv->startrow + wlv->filler_lines || !has_cpo_n) - && !(has_cpo_n && wp->w_skipcol > 0 && wlv->lnum == wp->w_topline)) { - // If 'signcolumn' is set to 'number' and a sign is present - // in "lnum", then display the sign instead of the line - // number. + // there is no line number in a wrapped line when "n" is in + // 'cpoptions', but 'breakindent' assumes it anyway. + && !((has_cpo_n && !wp->w_p_bri) && wp->w_skipcol > 0 && wlv->lnum == wp->w_topline)) { + // If 'signcolumn' is set to 'number' and a sign is present in "lnum", + // then display the sign instead of the line number. if (*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u' && num_signs > 0) { get_sign_display_info(true, wp, wlv, sign_idx, sign_cul_attr); } else {