diff options
author | Maxim Kim <habamax@gmail.com> | 2022-09-02 14:08:53 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-02 14:08:53 +0100 |
commit | 119167265ebc7eced210a7f8ed2f4b90378f98f1 (patch) | |
tree | bbdedb6335ff49ab537ebc856d62daf7d0498182 /src/testdir | |
parent | cf2bb633978a3d2d5bba06611c95e15170662c15 (diff) |
patch 9.0.0358: 'breakindent' does not indent non-listsv9.0.0358
Problem: 'breakindent' does not indent non-lists with
"breakindentopt=list:-1".
Solution: Adjust indent computation. (Maxim Kim, closes #11038)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_breakindent.vim | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/src/testdir/test_breakindent.vim b/src/testdir/test_breakindent.vim index 7163f25bd3..1c02294bc4 100644 --- a/src/testdir/test_breakindent.vim +++ b/src/testdir/test_breakindent.vim @@ -818,7 +818,7 @@ func Test_breakindent20_list() " check formatlistpat indent with different list level " showbreak and sbr - setl briopt=min:5,sbr,list:-1,shift:2 + setl briopt=min:5,sbr,list:-1 setl showbreak=> redraw! let expect = [ @@ -831,6 +831,44 @@ func Test_breakindent20_list() \ ] let lines = s:screen_lines2(1, 6, 20) call s:compare_lines(expect, lines) + + " check formatlistpat indent with different list level + " showbreak sbr and shift + setl briopt=min:5,sbr,list:-1,shift:2 + setl showbreak=> + redraw! + let expect = [ + \ "* Congress shall ", + \ "> make no law ", + \ "*** Congress shall ", + \ "> make no law ", + \ "**** Congress shall ", + \ "> make no law ", + \ ] + let lines = s:screen_lines2(1, 6, 20) + call s:compare_lines(expect, lines) + + " check breakindent works if breakindentopt=list:-1 + " for a non list content + %delete _ + call setline(1, [' Congress shall make no law', + \ ' Congress shall make no law', + \ ' Congress shall make no law']) + norm! 1gg + setl briopt=min:5,list:-1 + setl showbreak= + redraw! + let expect = [ + \ " Congress shall ", + \ " make no law ", + \ " Congress shall ", + \ " make no law ", + \ " Congress shall ", + \ " make no law ", + \ ] + let lines = s:screen_lines2(1, 6, 20) + call s:compare_lines(expect, lines) + call s:close_windows('set breakindent& briopt& linebreak& list& listchars& showbreak&') endfunc |