aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-05-10 23:21:43 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-05-11 22:30:24 -0400
commit801c8e06d60279d059073e0cf6901d43f6b3cc85 (patch)
treea09f33353bc3e7ea7d63f312f6aa1d1ab11bace8
parent393dc2b0f5f6bdbaa4499d07e9a1d90d924d6441 (diff)
downloadrneovim-801c8e06d60279d059073e0cf6901d43f6b3cc85.tar.gz
rneovim-801c8e06d60279d059073e0cf6901d43f6b3cc85.tar.bz2
rneovim-801c8e06d60279d059073e0cf6901d43f6b3cc85.zip
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
-rw-r--r--src/nvim/screen.c2
-rw-r--r--src/nvim/testdir/test_breakindent.vim10
2 files changed, 11 insertions, 1 deletions
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