annotate src/testdir/test_breakindent.vim @ 15439:ffcd5473738f

Added tag v8.1.0727 for changeset 79b56abd37c69fe8c3b73183d6be5cad2a30fabd
author Bram Moolenaar <Bram@vim.org>
date Fri, 11 Jan 2019 21:00:08 +0100
parents 2ad722003b36
children ba7727889385
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for breakindent
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 "
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Note: if you get strange failures when adding new tests, it might be that
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " while the test is run, the breakindent cacheing gets in its way.
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
5 " It helps to change the tabstop setting and force a redraw (e.g. see
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " Test_breakindent08())
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 if !exists('+breakindent')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 finish
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 endif
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
11 source view_util.vim
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
12
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let s:input ="\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
15 func s:screen_lines(lnum, width) abort
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
16 return ScreenLines([a:lnum, a:lnum + 2], a:width)
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
17 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
19 func s:compare_lines(expect, actual)
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
20 call assert_equal(join(a:expect, "\n"), join(a:actual, "\n"))
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
21 endfunc
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
22
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
23 func s:test_windows(...)
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
24 call NewWindow(10, 20)
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
25 setl ts=4 sw=4 sts=4 breakindent
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 put =s:input
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
27 exe get(a:000, 0, '')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
28 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
30 func s:close_windows(...)
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
31 call CloseWindow()
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
32 exe get(a:000, 0, '')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
33 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
35 func Test_breakindent01()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 " simple breakindent test
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
37 call s:test_windows('setl briopt=min:0')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
38 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
39 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
40 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
41 \ " qrst",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
42 \ " GHIJ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
43 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
44 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 call s:close_windows()
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
46 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
48 func Test_breakindent01_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
49 " like 01 but with vartabs feature
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
50 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
51 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
52 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
53 call s:test_windows('setl briopt=min:0 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
54 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
55 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
56 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
57 \ " qrst",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
58 \ " GHIJ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
59 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
60 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
61 call s:close_windows('set vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
62 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
63
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
64 func Test_breakindent02()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 " simple breakindent test with showbreak set
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
66 call s:test_windows('setl briopt=min:0 sbr=>>')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
67 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
68 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
69 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
70 \ " >>qr",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
71 \ " >>EF",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
72 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
73 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 call s:close_windows('set sbr=')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
75 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
77 func Test_breakindent02_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
78 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
79 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
80 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
81 " simple breakindent test with showbreak set
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
82 call s:test_windows('setl briopt=min:0 sbr=>> vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
83 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
84 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
85 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
86 \ " >>qr",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
87 \ " >>EF",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
88 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
89 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
90 call s:close_windows('set sbr= vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
91 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
92
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
93 func Test_breakindent03()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 " simple breakindent test with showbreak set and briopt including sbr
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
95 call s:test_windows('setl briopt=sbr,min:0 sbr=++')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
96 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
97 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
98 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
99 \ "++ qrst",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
100 \ "++ GHIJ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
101 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
102 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
103 " clean up
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
104 call s:close_windows('set sbr=')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
105 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
106
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
107 func Test_breakindent03_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
108 " simple breakindent test with showbreak set and briopt including sbr
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
109 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
110 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
111 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
112 call s:test_windows('setl briopt=sbr,min:0 sbr=++ vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
113 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
114 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
115 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
116 \ "++ qrst",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
117 \ "++ GHIJ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
118 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
119 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
120 " clean up
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
121 call s:close_windows('set sbr= vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
122 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
123
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
124 func Test_breakindent04()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
125 " breakindent set with min width 18
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
126 call s:test_windows('setl sbr= briopt=min:18')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
127 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
128 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
129 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
130 \ " qrstuv",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
131 \ " IJKLMN",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
132 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
133 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134 " clean up
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
135 call s:close_windows('set sbr=')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
136 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
138 func Test_breakindent04_vartabs()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
139 " breakindent set with min width 18
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
140 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
141 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
142 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
143 call s:test_windows('setl sbr= briopt=min:18 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
144 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
145 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
146 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
147 \ " qrstuv",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
148 \ " IJKLMN",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
149 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
150 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
151 " clean up
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
152 call s:close_windows('set sbr= vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
153 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
154
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
155 func Test_breakindent05()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
156 " breakindent set and shift by 2
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
157 call s:test_windows('setl briopt=shift:2,min:0')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
158 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
159 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
160 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
161 \ " qr",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
162 \ " EF",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
163 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
164 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
165 call s:close_windows()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
166 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
167
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
168 func Test_breakindent05_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
169 " breakindent set and shift by 2
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
170 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
171 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
172 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
173 call s:test_windows('setl briopt=shift:2,min:0 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
174 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
175 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
176 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
177 \ " qr",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
178 \ " EF",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
179 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
180 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
181 call s:close_windows('set vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
182 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
183
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
184 func Test_breakindent06()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
185 " breakindent set and shift by -1
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
186 call s:test_windows('setl briopt=shift:-1,min:0')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
187 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
188 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
189 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
190 \ " qrstu",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
191 \ " HIJKL",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
192 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
193 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
194 call s:close_windows()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
195 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
196
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
197 func Test_breakindent06_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
198 " breakindent set and shift by -1
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
199 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
200 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
201 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
202 call s:test_windows('setl briopt=shift:-1,min:0 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
203 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
204 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
205 \ " abcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
206 \ " qrstu",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
207 \ " HIJKL",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
208 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
209 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
210 call s:close_windows('set vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
211 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
212
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
213 func Test_breakindent07()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
214 " breakindent set and shift by 1, Number set sbr=? and briopt:sbr
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
215 call s:test_windows('setl briopt=shift:1,sbr,min:0 nu sbr=? nuw=4 cpo+=n')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
216 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
217 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
218 \ " 2 ab",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
219 \ "? m",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
220 \ "? x",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
221 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
222 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
223 " clean up
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
224 call s:close_windows('set sbr= cpo-=n')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
225 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
226
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
227 func Test_breakindent07_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
228 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
229 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
230 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
231 " breakindent set and shift by 1, Number set sbr=? and briopt:sbr
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
232 call s:test_windows('setl briopt=shift:1,sbr,min:0 nu sbr=? nuw=4 cpo+=n vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
233 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
234 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
235 \ " 2 ab",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
236 \ "? m",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
237 \ "? x",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
238 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
239 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
240 " clean up
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
241 call s:close_windows('set sbr= cpo-=n vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
242 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
243
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
244 func Test_breakindent07a()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
245 " breakindent set and shift by 1, Number set sbr=? and briopt:sbr
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
246 call s:test_windows('setl briopt=shift:1,sbr,min:0 nu sbr=? nuw=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
247 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
248 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
249 \ " 2 ab",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
250 \ " ? m",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
251 \ " ? x",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
252 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
253 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
254 " clean up
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
255 call s:close_windows('set sbr=')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
256 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
257
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
258 func Test_breakindent07a_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
259 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
260 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
261 endif
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
262 " breakindent set and shift by 1, Number set sbr=? and briopt:sbr
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
263 call s:test_windows('setl briopt=shift:1,sbr,min:0 nu sbr=? nuw=4 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
264 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
265 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
266 \ " 2 ab",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
267 \ " ? m",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
268 \ " ? x",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
269 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
270 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
271 " clean up
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
272 call s:close_windows('set sbr= vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
273 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
274
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
275 func Test_breakindent08()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
276 " breakindent set and shift by 1, Number and list set sbr=# and briopt:sbr
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
277 call s:test_windows('setl briopt=shift:1,sbr,min:0 nu nuw=4 sbr=# list cpo+=n ts=4')
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
278 " make sure, cache is invalidated!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
279 set ts=8
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
280 redraw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
281 set ts=4
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
282 redraw!
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
283 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
284 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
285 \ " 2 ^Iabcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
286 \ "# opq",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
287 \ "# BCD",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
288 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
289 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
290 call s:close_windows('set sbr= cpo-=n')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
291 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
292
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
293 func Test_breakindent08_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
294 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
295 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
296 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
297 " breakindent set and shift by 1, Number and list set sbr=# and briopt:sbr
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
298 call s:test_windows('setl briopt=shift:1,sbr,min:0 nu nuw=4 sbr=# list cpo+=n ts=4 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
299 " make sure, cache is invalidated!
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
300 set ts=8
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
301 redraw!
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
302 set ts=4
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
303 redraw!
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
304 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
305 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
306 \ " 2 ^Iabcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
307 \ "# opq",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
308 \ "# BCD",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
309 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
310 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
311 call s:close_windows('set sbr= cpo-=n vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
312 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
313
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
314 func Test_breakindent08a()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
315 " breakindent set and shift by 1, Number and list set sbr=# and briopt:sbr
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
316 call s:test_windows('setl briopt=shift:1,sbr,min:0 nu nuw=4 sbr=# list')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
317 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
318 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
319 \ " 2 ^Iabcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
320 \ " # opq",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
321 \ " # BCD",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
322 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
323 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
324 call s:close_windows('set sbr=')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
325 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
326
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
327 func Test_breakindent08a_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
328 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
329 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
330 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
331 " breakindent set and shift by 1, Number and list set sbr=# and briopt:sbr
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
332 call s:test_windows('setl briopt=shift:1,sbr,min:0 nu nuw=4 sbr=# list vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
333 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
334 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
335 \ " 2 ^Iabcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
336 \ " # opq",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
337 \ " # BCD",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
338 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
339 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
340 call s:close_windows('set sbr= vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
341 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
342
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
343 func Test_breakindent09()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
344 " breakindent set and shift by 1, Number and list set sbr=#
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
345 call s:test_windows('setl briopt=shift:1,min:0 nu nuw=4 sbr=# list')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
346 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
347 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
348 \ " 2 ^Iabcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
349 \ " #op",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
350 \ " #AB",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
351 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
352 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
353 call s:close_windows('set sbr=')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
354 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
355
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
356 func Test_breakindent09_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
357 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
358 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
359 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
360 " breakindent set and shift by 1, Number and list set sbr=#
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
361 call s:test_windows('setl briopt=shift:1,min:0 nu nuw=4 sbr=# list vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
362 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
363 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
364 \ " 2 ^Iabcd",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
365 \ " #op",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
366 \ " #AB",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
367 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
368 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
369 call s:close_windows('set sbr= vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
370 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
371
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
372 func Test_breakindent10()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
373 " breakindent set, Number set sbr=~
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
374 call s:test_windows('setl cpo+=n sbr=~ nu nuw=4 nolist briopt=sbr,min:0')
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
375 " make sure, cache is invalidated!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
376 set ts=8
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
377 redraw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
378 set ts=4
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
379 redraw!
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
380 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
381 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
382 \ " 2 ab",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
383 \ "~ mn",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
384 \ "~ yz",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
385 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
386 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
387 call s:close_windows('set sbr= cpo-=n')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
388 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
389
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
390 func Test_breakindent10_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
391 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
392 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
393 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
394 " breakindent set, Number set sbr=~
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
395 call s:test_windows('setl cpo+=n sbr=~ nu nuw=4 nolist briopt=sbr,min:0 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
396 " make sure, cache is invalidated!
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
397 set ts=8
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
398 redraw!
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
399 set ts=4
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
400 redraw!
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
401 let lines = s:screen_lines(line('.'),10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
402 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
403 \ " 2 ab",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
404 \ "~ mn",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
405 \ "~ yz",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
406 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
407 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
408 call s:close_windows('set sbr= cpo-=n vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
409 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
410
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
411 func Test_breakindent11()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
412 " test strdisplaywidth()
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
413 call s:test_windows('setl cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
414 let text = getline(2)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
415 let width = strlen(text[1:])+indent(2)+strlen(&sbr)*3 " text wraps 3 times
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
416 call assert_equal(width, strdisplaywidth(text))
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
417 call s:close_windows('set sbr=')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
418 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
419
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
420 func Test_breakindent11_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
421 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
422 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
423 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
424 " test strdisplaywidth()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
425 call s:test_windows('setl cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
426 let text = getline(2)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
427 let width = strlen(text[1:])+indent(2)+strlen(&sbr)*3 " text wraps 3 times
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
428 call assert_equal(width, strdisplaywidth(text))
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
429 call s:close_windows('set sbr= vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
430 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
431
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
432 func Test_breakindent12()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
433 " test breakindent with long indent
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
434 let s:input = "\t\t\t\t\t{"
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
435 call s:test_windows('setl breakindent linebreak briopt=min:10 nu numberwidth=3 ts=4 list listchars=tab:>-')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
436 let lines = s:screen_lines(2,16)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
437 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
438 \ " 2 >--->--->--->",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
439 \ " ---{ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
440 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
441 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
442 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
443 call s:close_windows('set nuw=4 listchars=')
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
444 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
445
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
446 func Test_breakindent12_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
447 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
448 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
449 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
450 " test breakindent with long indent
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
451 let s:input = "\t\t\t\t\t{"
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
452 call s:test_windows('setl breakindent linebreak briopt=min:10 nu numberwidth=3 ts=4 list listchars=tab:>- vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
453 let lines = s:screen_lines(2,16)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
454 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
455 \ " 2 >--->--->--->",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
456 \ " ---{ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
457 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
458 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
459 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
460 call s:close_windows('set nuw=4 listchars= vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
461 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
462
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
463 func Test_breakindent13()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
464 let s:input = ""
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
465 call s:test_windows('setl breakindent briopt=min:10 ts=8')
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
466 vert resize 20
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
467 call setline(1, [" a\tb\tc\td\te", " z y x w v"])
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
468 1
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
469 norm! fbgj"ayl
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
470 2
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
471 norm! fygj"byl
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
472 call assert_equal('d', @a)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
473 call assert_equal('w', @b)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
474 call s:close_windows()
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
475 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
476
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
477 func Test_breakindent13_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
478 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
479 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
480 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
481 let s:input = ""
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
482 call s:test_windows('setl breakindent briopt=min:10 ts=8 vts=8')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
483 vert resize 20
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
484 call setline(1, [" a\tb\tc\td\te", " z y x w v"])
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
485 1
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
486 norm! fbgj"ayl
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
487 2
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
488 norm! fygj"byl
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
489 call assert_equal('d', @a)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
490 call assert_equal('w', @b)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
491 call s:close_windows('set vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
492 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
493
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
494 func Test_breakindent14()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
495 let s:input = ""
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
496 call s:test_windows('setl breakindent briopt= ts=8')
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
497 vert resize 30
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
498 norm! 3a1234567890
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
499 norm! a abcde
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
500 exec "norm! 0\<C-V>tex"
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
501 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
502 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
503 \ "e ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
504 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
505 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
506 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
507 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
508 call s:close_windows()
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
509 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
510
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
511 func Test_breakindent14_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
512 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
513 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
514 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
515 let s:input = ""
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
516 call s:test_windows('setl breakindent briopt= ts=8 vts=8')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
517 vert resize 30
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
518 norm! 3a1234567890
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
519 norm! a abcde
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
520 exec "norm! 0\<C-V>tex"
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
521 let lines = s:screen_lines(line('.'),8)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
522 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
523 \ "e ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
524 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
525 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
526 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
527 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
528 call s:close_windows('set vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
529 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
530
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
531 func Test_breakindent15()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
532 let s:input = ""
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
533 call s:test_windows('setl breakindent briopt= ts=8 sw=8')
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
534 vert resize 30
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
535 norm! 4a1234567890
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
536 exe "normal! >>\<C-V>3f0x"
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
537 let lines = s:screen_lines(line('.'),20)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
538 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
539 \ " 1234567890 ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
540 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
541 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
542 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
543 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
544 call s:close_windows()
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
545 endfunc
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
546
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
547 func Test_breakindent15_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
548 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
549 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
550 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
551 let s:input = ""
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
552 call s:test_windows('setl breakindent briopt= ts=8 sw=8 vts=8')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
553 vert resize 30
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
554 norm! 4a1234567890
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
555 exe "normal! >>\<C-V>3f0x"
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
556 let lines = s:screen_lines(line('.'),20)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
557 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
558 \ " 1234567890 ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
559 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
560 \ "~ ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
561 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
562 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
563 call s:close_windows('set vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
564 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
565
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
566 func Test_breakindent16()
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
567 " Check that overlong lines are indented correctly.
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
568 let s:input = ""
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
569 call s:test_windows('setl breakindent briopt=min:0 ts=4')
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
570 call setline(1, "\t".repeat("1234567890", 10))
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
571 resize 6
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
572 norm! 1gg$
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
573 redraw!
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
574 let lines = s:screen_lines(1,10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
575 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
576 \ " 789012",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
577 \ " 345678",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
578 \ " 901234",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
579 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
580 call s:compare_lines(expect, lines)
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
581 let lines = s:screen_lines(4,10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
582 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
583 \ " 567890",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
584 \ " 123456",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
585 \ " 7890 ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
586 \ ]
10843
678edb254216 patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents: 10392
diff changeset
587 call s:compare_lines(expect, lines)
10392
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
588 call s:close_windows()
14175
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
589 endfunc
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
590
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
591 func Test_breakindent16_vartabs()
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
592 if !has("vartabs")
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
593 return
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
594 endif
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
595 " Check that overlong lines are indented correctly.
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
596 let s:input = ""
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
597 call s:test_windows('setl breakindent briopt=min:0 ts=4 vts=4')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
598 call setline(1, "\t".repeat("1234567890", 10))
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
599 resize 6
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
600 norm! 1gg$
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
601 redraw!
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
602 let lines = s:screen_lines(1,10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
603 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
604 \ " 789012",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
605 \ " 345678",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
606 \ " 901234",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
607 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
608 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
609 let lines = s:screen_lines(4,10)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
610 let expect = [
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
611 \ " 567890",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
612 \ " 123456",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
613 \ " 7890 ",
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
614 \ ]
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
615 call s:compare_lines(expect, lines)
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
616 call s:close_windows('set vts&')
2ad722003b36 patch 8.1.0105: all tab stops are the same
Christian Brabandt <cb@256bit.org>
parents: 11010
diff changeset
617 endfunc