diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 35038f4717..c9cd08fedd 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -596,8 +596,7 @@ static void handle_lnum_col(win_T *wp, winlinevars_T *wlv, int num_signs, int si int sign_num_attr, int sign_cul_attr) { if ((wp->w_p_nu || wp->w_p_rnu) - && ((wlv->row == wlv->startrow + wlv->filler_lines - && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow)) + && (wlv->row == wlv->startrow + wlv->filler_lines || vim_strchr(p_cpo, CPO_NUMCOL) == NULL)) { // If 'signcolumn' is set to 'number' and a sign is present // in "lnum", then display the sign instead of the line @@ -606,7 +605,8 @@ static void handle_lnum_col(win_T *wp, winlinevars_T *wlv, int num_signs, int si get_sign_display_info(true, wp, wlv, sign_idx, sign_cul_attr); } else { // Draw the line number (empty space after wrapping). - if (wlv->row == wlv->startrow + wlv->filler_lines) { + if (wlv->row == wlv->startrow + wlv->filler_lines + && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow)) { get_line_number_str(wp, wlv->lnum, wlv->extra, sizeof(wlv->extra)); if (wp->w_skipcol > 0 && wlv->startrow == 0) { for (wlv->p_extra = wlv->extra; *wlv->p_extra == ' '; wlv->p_extra++) { diff --git a/test/old/testdir/test_breakindent.vim b/test/old/testdir/test_breakindent.vim index de25f9b787..9cc398f64a 100644 --- a/test/old/testdir/test_breakindent.vim +++ b/test/old/testdir/test_breakindent.vim @@ -711,14 +711,14 @@ endfunc func Test_breakindent20_cpo_n_nextpage() let s:input = "" call s:test_windows('setl breakindent briopt=min:14 cpo+=n number') - call setline(1, repeat('a', 200)) + call setline(1, repeat('abcdefghijklmnopqrst', 10)) norm! 1gg redraw! let lines = s:screen_lines(1, 20) let expect = [ - \ " 1 aaaaaaaaaaaaaaaa", - \ " aaaaaaaaaaaaaaaa", - \ " aaaaaaaaaaaaaaaa", + \ " 1 abcdefghijklmnop", + \ " qrstabcdefghijkl", + \ " mnopqrstabcdefgh", \ ] call s:compare_lines(expect, lines) " Scroll down one screen line @@ -726,11 +726,10 @@ func Test_breakindent20_cpo_n_nextpage() norm! 5gj redraw! let lines = s:screen_lines(1, 20) - " FIXME: this is not the right result let expect = [ - \ "<<