From 801c8e06d60279d059073e0cf6901d43f6b3cc85 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 10 May 2020 23:21:43 -0400 Subject: [PATCH] vim-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 vim/vim#5523, closes vim/vim#5684) https://github.com/vim/vim/commit/1aa76b8fd06c278fe36c39b0bbe7233c775d7423 --- src/nvim/screen.c | 2 +- src/nvim/testdir/test_breakindent.vim | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 8f8bfee60c..a165ce2586 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2994,7 +2994,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', diff --git a/src/nvim/testdir/test_breakindent.vim b/src/nvim/testdir/test_breakindent.vim index 6d88f1dc5a..5675bf74dd 100644 --- a/src/nvim/testdir/test_breakindent.vim +++ b/src/nvim/testdir/test_breakindent.vim @@ -361,5 +361,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