diff --git a/src/drawline.c b/src/drawline.c index 3e8b8b9500e2a3..4723915830df11 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -1176,6 +1176,8 @@ win_line( c_final = NUL; n_extra = get_breakindent_win(wp, ml_get_buf(wp->w_buffer, lnum, FALSE)); + if (wp->w_skipcol > 0 && wp->w_p_wrap) + need_showbreak = FALSE; // Correct end of highlighted area for 'breakindent', // required when 'linebreak' is also set. if (tocol == vcol) @@ -1222,7 +1224,8 @@ win_line( c_extra = NUL; c_final = NUL; n_extra = (int)STRLEN(sbr); - need_showbreak = FALSE; + if (wp->w_skipcol == 0 || !wp->w_p_wrap) + need_showbreak = FALSE; vcol_sbr = vcol + MB_CHARLEN(sbr); // Correct end of highlighted area for 'showbreak', // required when 'linebreak' is also set. diff --git a/src/testdir/test_breakindent.vim b/src/testdir/test_breakindent.vim index ee61cbc9db9ddf..ec99aa9dfef85a 100644 --- a/src/testdir/test_breakindent.vim +++ b/src/testdir/test_breakindent.vim @@ -658,3 +658,29 @@ func Test_breakindent18_vartabs() call s:close_windows('set breakindent& list& listchars&') endfunc +func Test_breakindent19_sbr_nextpage() + let s:input = "" + call s:test_windows('setl breakindent briopt=shift:2,sbr,min:18 sbr=>') + call setline(1, repeat('a', 200)) + norm! 1gg + redraw! + let lines = s:screen_lines(1, 20) + let expect = [ + \ "aaaaaaaaaaaaaaaaaaaa", + \ "> aaaaaaaaaaaaaaaaaa", + \ "> aaaaaaaaaaaaaaaaaa", + \ ] + call s:compare_lines(expect, lines) + " Go to next page + setl scrolloff=5 + norm! 5gj + redraw! + let lines = s:screen_lines(1, 20) + let expect = [ + \ "> aaaaaaaaaaaaaaaaaa", + \ "> aaaaaaaaaaaaaaaaaa", + \ "> aaaaaaaaaaaaaaaaaa", + \ ] + call s:compare_lines(expect, lines) + call s:close_windows('set breakindent& briopt& sbr&') +endfunc