vim-patch:9.0.2017: linebreak applies for leading whitespace

Problem:  linebreak applies for leading whitespace
Solution: only apply linebreak, once we have found non-breakat chars in
          the line

closes: vim/vim#13228
closes: vim/vim#13243

dd75fcfbdf

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2023-10-12 06:49:11 +08:00
parent 7474874baa
commit dac79b165d
3 changed files with 41 additions and 3 deletions

View File

@@ -373,4 +373,19 @@ func Test_ctrl_char_on_wrap_column()
call s:close_windows()
endfunc
func Test_linebreak_no_break_after_whitespace_only()
call s:test_windows('setl ts=4 linebreak wrap')
call setline(1, "\tabcdefghijklmnopqrstuvwxyz" ..
\ "abcdefghijklmnopqrstuvwxyz")
let lines = s:screen_lines([1, 4], winwidth(0))
let expect = [
\ " abcdefghijklmnop",
\ "qrstuvwxyzabcdefghij",
\ "klmnopqrstuvwxyz ",
\ "~ ",
\ ]
call s:compare_lines(expect, lines)
call s:close_windows()
endfunc
" vim: shiftwidth=2 sts=2 expandtab