diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-08-08 18:07:57 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-08-08 22:22:34 -0400 |
| commit | 43a874ab7441a4a0ab6e973f4fd7add394ed6dd9 (patch) | |
| tree | ecba9c783bf59e7c7e3658ad7175da297af9f32f /src/nvim/testdir | |
| parent | f89a275e32110a63e8ee1fc6ca75e0cf09194185 (diff) | |
| download | rneovim-43a874ab7441a4a0ab6e973f4fd7add394ed6dd9.tar.gz rneovim-43a874ab7441a4a0ab6e973f4fd7add394ed6dd9.tar.bz2 rneovim-43a874ab7441a4a0ab6e973f4fd7add394ed6dd9.zip | |
vim-patch:8.2.3198: cannot use 'formatlistpat' for breakindent
Problem: Cannot use 'formatlistpat' for breakindent.
Solution: Use a negative list indent. (Maxim Kim, closes vim/vim#8594)
https://github.com/vim/vim/commit/f674b358fc18cf1641a066cc5de73da69e651024
Port get_showbreak_value() from patch v8.1.2281
to avoid breaking changes when porting older patches.
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_breakindent.vim | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_breakindent.vim b/src/nvim/testdir/test_breakindent.vim index dbaa4c44a0..5542746a04 100644 --- a/src/nvim/testdir/test_breakindent.vim +++ b/src/nvim/testdir/test_breakindent.vim @@ -796,6 +796,7 @@ func Test_breakindent20_list() \ ] let lines = s:screen_lines2(1, 9, 20) call s:compare_lines(expect, lines) + " reset linebreak option " Note: it indents by one additional " space, because of the leading space. @@ -812,7 +813,59 @@ func Test_breakindent20_list() let lines = s:screen_lines2(1, 6, 20) call s:compare_lines(expect, lines) - call s:close_windows('set breakindent& briopt& linebreak& list& listchars&') + " check formatlistpat indent + setl briopt=min:5,list:-1 + setl linebreak list&vim listchars&vim + let &l:flp = '^\s*\d\+\.\?[\]:)}\t ]\s*' + redraw! + let expect = [ + \ " 1. Congress ", + \ " shall make no ", + \ " law ", + \ " 2.) Congress ", + \ " shall make no ", + \ " law ", + \ " 3.] Congress ", + \ " shall make no ", + \ " law ", + \ ] + let lines = s:screen_lines2(1, 9, 20) + call s:compare_lines(expect, lines) + " check formatlistpat indent with different list levels + let &l:flp = '^\s*\*\+\s\+' + redraw! + %delete _ + call setline(1, ['* Congress shall make no law', + \ '*** Congress shall make no law', + \ '**** Congress shall make no law']) + norm! 1gg + 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 formatlistpat indent with different list level + " showbreak and sbr + 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) + call s:close_windows('set breakindent& briopt& linebreak& list& listchars& showbreak&') endfunc " vim: shiftwidth=2 sts=2 expandtab |