Mercurial > vim
comparison src/testdir/test_breakindent.vim @ 30041:1100c9c3fd2a v9.0.0358
patch 9.0.0358: 'breakindent' does not indent non-lists
Commit: https://github.com/vim/vim/commit/119167265ebc7eced210a7f8ed2f4b90378f98f1
Author: Maxim Kim <habamax@gmail.com>
Date: Fri Sep 2 14:08:53 2022 +0100
patch 9.0.0358: 'breakindent' does not indent non-lists
Problem: 'breakindent' does not indent non-lists with
"breakindentopt=list:-1".
Solution: Adjust indent computation. (Maxim Kim, closes #11038)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 02 Sep 2022 15:15:03 +0200 |
parents | 336c99d14cc5 |
children | ba5ca7c7d44c |
comparison
equal
deleted
inserted
replaced
30040:d5a6eb942188 | 30041:1100c9c3fd2a |
---|---|
816 let lines = s:screen_lines2(1, 6, 20) | 816 let lines = s:screen_lines2(1, 6, 20) |
817 call s:compare_lines(expect, lines) | 817 call s:compare_lines(expect, lines) |
818 | 818 |
819 " check formatlistpat indent with different list level | 819 " check formatlistpat indent with different list level |
820 " showbreak and sbr | 820 " showbreak and sbr |
821 setl briopt=min:5,sbr,list:-1,shift:2 | 821 setl briopt=min:5,sbr,list:-1 |
822 setl showbreak=> | 822 setl showbreak=> |
823 redraw! | 823 redraw! |
824 let expect = [ | 824 let expect = [ |
825 \ "* Congress shall ", | 825 \ "* Congress shall ", |
826 \ "> make no law ", | 826 \ "> make no law ", |
829 \ "**** Congress shall ", | 829 \ "**** Congress shall ", |
830 \ "> make no law ", | 830 \ "> make no law ", |
831 \ ] | 831 \ ] |
832 let lines = s:screen_lines2(1, 6, 20) | 832 let lines = s:screen_lines2(1, 6, 20) |
833 call s:compare_lines(expect, lines) | 833 call s:compare_lines(expect, lines) |
834 | |
835 " check formatlistpat indent with different list level | |
836 " showbreak sbr and shift | |
837 setl briopt=min:5,sbr,list:-1,shift:2 | |
838 setl showbreak=> | |
839 redraw! | |
840 let expect = [ | |
841 \ "* Congress shall ", | |
842 \ "> make no law ", | |
843 \ "*** Congress shall ", | |
844 \ "> make no law ", | |
845 \ "**** Congress shall ", | |
846 \ "> make no law ", | |
847 \ ] | |
848 let lines = s:screen_lines2(1, 6, 20) | |
849 call s:compare_lines(expect, lines) | |
850 | |
851 " check breakindent works if breakindentopt=list:-1 | |
852 " for a non list content | |
853 %delete _ | |
854 call setline(1, [' Congress shall make no law', | |
855 \ ' Congress shall make no law', | |
856 \ ' Congress shall make no law']) | |
857 norm! 1gg | |
858 setl briopt=min:5,list:-1 | |
859 setl showbreak= | |
860 redraw! | |
861 let expect = [ | |
862 \ " Congress shall ", | |
863 \ " make no law ", | |
864 \ " Congress shall ", | |
865 \ " make no law ", | |
866 \ " Congress shall ", | |
867 \ " make no law ", | |
868 \ ] | |
869 let lines = s:screen_lines2(1, 6, 20) | |
870 call s:compare_lines(expect, lines) | |
871 | |
834 call s:close_windows('set breakindent& briopt& linebreak& list& listchars& showbreak&') | 872 call s:close_windows('set breakindent& briopt& linebreak& list& listchars& showbreak&') |
835 endfunc | 873 endfunc |
836 | 874 |
837 " The following used to crash Vim. This is fixed by 8.2.3391. | 875 " The following used to crash Vim. This is fixed by 8.2.3391. |
838 " This is a regression introduced by 8.2.2903. | 876 " This is a regression introduced by 8.2.2903. |