# HG changeset patch # User Bram Moolenaar # Date 1582468203 -3600 # Node ID f872daa2031b87f19c4948256146e4267c4c0438 # Parent 6b592f4a53c138c88e258c1ce7b80c586925a590 patch 8.2.0308: 'showbreak' does not work for a very long line Commit: https://github.com/vim/vim/commit/1aa76b8fd06c278fe36c39b0bbe7233c775d7423 Author: Bram Moolenaar Date: Sun Feb 23 15:17:27 2020 +0100 patch 8.2.0308: 'showbreak' does not work for a very long line Problem: 'showbreak' does not work for a very long line. (John Little) Solution: Check whether 'briopt' contains "sbr". (Ken Takata, closes https://github.com/vim/vim/issues/5523, closes #5684) diff --git a/src/drawline.c b/src/drawline.c --- a/src/drawline.c +++ b/src/drawline.c @@ -1176,7 +1176,7 @@ 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) + if (wp->w_skipcol > 0 && wp->w_p_wrap && wp->w_p_brisbr) need_showbreak = FALSE; // Correct end of highlighted area for 'breakindent', // required when 'linebreak' is also set. diff --git a/src/testdir/test_breakindent.vim b/src/testdir/test_breakindent.vim --- a/src/testdir/test_breakindent.vim +++ b/src/testdir/test_breakindent.vim @@ -682,5 +682,15 @@ func Test_breakindent19_sbr_nextpage() \ "> aaaaaaaaaaaaaaaaaa", \ ] call s:compare_lines(expect, lines) + + setl breakindent briopt=min:18 sbr=> + norm! 5gj + let lines = s:screen_lines(1, 20) + let expect = [ + \ ">aaaaaaaaaaaaaaaaaaa", + \ ">aaaaaaaaaaaaaaaaaaa", + \ ">aaaaaaaaaaaaaaaaaaa", + \ ] + call s:compare_lines(expect, lines) call s:close_windows('set breakindent& briopt& sbr&') endfunc diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 308, +/**/ 307, /**/ 306,