@@ -759,6 +759,7 @@ func Test_breakindent20_list()
759759 \ ]
760760 let lines = s: screen_lines2 (1 , 9 , 20 )
761761 call s: compare_lines (expect, lines )
762+
762763 " reset linebreak option
763764 " Note: it indents by one additional
764765 " space, because of the leading space.
@@ -775,7 +776,59 @@ func Test_breakindent20_list()
775776 let lines = s: screen_lines2 (1 , 6 , 20 )
776777 call s: compare_lines (expect, lines )
777778
778- call s: close_windows (' set breakindent& briopt& linebreak& list& listchars&' )
779+ " check formatlistpat indent
780+ setl briopt = min :5 ,list :-1
781+ setl linebreak list &vim listchars &vim
782+ let &l: flp = ' ^\s*\d\+\.\?[\]:)}\t ]\s*'
783+ redraw !
784+ let expect = [
785+ \ " 1. Congress " ,
786+ \ " shall make no " ,
787+ \ " law " ,
788+ \ " 2.) Congress " ,
789+ \ " shall make no " ,
790+ \ " law " ,
791+ \ " 3.] Congress " ,
792+ \ " shall make no " ,
793+ \ " law " ,
794+ \ ]
795+ let lines = s: screen_lines2 (1 , 9 , 20 )
796+ call s: compare_lines (expect, lines )
797+ " check formatlistpat indent with different list levels
798+ let &l: flp = ' ^\s*\*\+\s\+'
799+ redraw !
800+ % delete _
801+ call setline (1 , [' * Congress shall make no law' ,
802+ \ ' *** Congress shall make no law' ,
803+ \ ' **** Congress shall make no law' ])
804+ norm! 1 gg
805+ let expect = [
806+ \ " * Congress shall " ,
807+ \ " make no law " ,
808+ \ " *** Congress shall " ,
809+ \ " make no law " ,
810+ \ " **** Congress shall " ,
811+ \ " make no law " ,
812+ \ ]
813+ let lines = s: screen_lines2 (1 , 6 , 20 )
814+ call s: compare_lines (expect, lines )
815+
816+ " check formatlistpat indent with different list level
817+ " showbreak and sbr
818+ setl briopt = min :5 ,sbr ,list :-1 ,shift:2
819+ setl showbreak = >
820+ redraw !
821+ let expect = [
822+ \ " * Congress shall " ,
823+ \ " > make no law " ,
824+ \ " *** Congress shall " ,
825+ \ " > make no law " ,
826+ \ " **** Congress shall " ,
827+ \ " > make no law " ,
828+ \ ]
829+ let lines = s: screen_lines2 (1 , 6 , 20 )
830+ call s: compare_lines (expect, lines )
831+ call s: close_windows (' set breakindent& briopt& linebreak& list& listchars& showbreak&' )
779832endfunc
780833
781834" vim: shiftwidth = 2 sts = 2 expandtab
0 commit comments