]> granicus.if.org Git - vim/commitdiff
patch 8.2.0308: 'showbreak' does not work for a very long line v8.2.0308
authorBram Moolenaar <Bram@vim.org>
Sun, 23 Feb 2020 14:17:27 +0000 (15:17 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 23 Feb 2020 14:17:27 +0000 (15:17 +0100)
Problem:    'showbreak' does not work for a very long line. (John Little)
Solution:   Check whether 'briopt' contains "sbr". (Ken Takata, closes #5523,
            closes #5684)

src/drawline.c
src/testdir/test_breakindent.vim
src/version.c

index 176aa69598d71e201ae1ac6891c1225cf5fddd6e..b5814114b6e2428d67d8d82b983b036c8b86930c 100644 (file)
@@ -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.
index 6e4e090f79a842729b6c6e7d6cb2925e5f783c1d..ad4ae1dc26aa51e7b83a37dec93f853c7b141790 100644 (file)
@@ -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
index 373eb163cbb0ba832b4e89392ec16c90c70e8df6..db0034433386ae97b75a535365309100b2eb4906 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    308,
 /**/
     307,
 /**/