annotate src/testdir/test_breakindent.vim @ 10392:957a1d560bda v8.0.0090

commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 17 19:46:51 2016 +0100 patch 8.0.0090 Problem: Test_help_complete sometimes fails in MS-Windows console. Solution: Use getcompletion() instead of feedkeys() and command line completion. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Thu, 17 Nov 2016 20:00:05 +0100
parents
children 678edb254216
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.
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 " It helps to change the tabastop setting and force a redraw (e.g. see
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
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 let s:input ="\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 function s:screenline(lnum, width) abort
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 " always get 4 screen lines
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 redraw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 let line = []
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 for j in range(3)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 for c in range(1, a:width)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call add(line, nr2char(screenchar(a:lnum+j, c)))
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 endfor
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call add(line, "\n")
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 endfor
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 return join(line, '')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 function s:testwindows(...)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 10new
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 vsp
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 vert resize 20
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 setl ts=4 sw=4 sts=4 breakindent
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 put =s:input
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 if a:0
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 exe a:1
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 endif
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 function s:close_windows(...)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 bw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 if a:0
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 exe a:1
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 endif
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 unlet! g:line g:expect
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 function Test_breakindent01()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 " simple breakindent test
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 call s:testwindows('setl briopt=min:0')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 let g:line=s:screenline(line('.'),8)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 let g:expect=" abcd\n qrst\n GHIJ\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 call s:close_windows()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 function Test_breakindent02()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 " simple breakindent test with showbreak set
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 call s:testwindows('setl briopt=min:0 sbr=>>')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 let g:line=s:screenline(line('.'),8)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 let g:expect=" abcd\n >>qr\n >>EF\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 call s:close_windows('set sbr=')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 function Test_breakindent03()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 " simple breakindent test with showbreak set and briopt including sbr
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 call s:testwindows('setl briopt=sbr,min:0 sbr=++')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 let g:line=s:screenline(line('.'),8)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 let g:expect=" abcd\n++ qrst\n++ GHIJ\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 " clean up
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 call s:close_windows('set sbr=')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 function Test_breakindent04()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 " breakindent set with min width 18
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 call s:testwindows('setl sbr= briopt=min:18')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 let g:line=s:screenline(line('.'),8)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 let g:expect=" abcd\n qrstuv\n IJKLMN\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 " clean up
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 call s:close_windows('set sbr=')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 function Test_breakindent05()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 " breakindent set and shift by 2
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 call s:testwindows('setl briopt=shift:2,min:0')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 let g:line=s:screenline(line('.'),8)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 let g:expect=" abcd\n qr\n EF\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 call s:close_windows()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 function Test_breakindent06()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 " breakindent set and shift by -1
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 call s:testwindows('setl briopt=shift:-1,min:0')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 let g:line=s:screenline(line('.'),8)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 let g:expect=" abcd\n qrstu\n HIJKL\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 call s:close_windows()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 function Test_breakindent07()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 " breakindent set and shift by 1, Number set sbr=? and briopt:sbr
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 call s:testwindows('setl briopt=shift:1,sbr,min:0 nu sbr=? nuw=4 cpo+=n')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 let g:line=s:screenline(line('.'),10)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 let g:expect=" 2 ab\n? m\n? x\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 " clean up
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 call s:close_windows('set sbr= cpo-=n')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 function Test_breakindent07a()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 " breakindent set and shift by 1, Number set sbr=? and briopt:sbr
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113 call s:testwindows('setl briopt=shift:1,sbr,min:0 nu sbr=? nuw=4')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 let g:line=s:screenline(line('.'),10)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 let g:expect=" 2 ab\n ? m\n ? x\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117 " clean up
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118 call s:close_windows('set sbr=')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 function Test_breakindent08()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 " breakindent set and shift by 1, Number and list set sbr=# and briopt:sbr
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123 call s:testwindows('setl briopt=shift:1,sbr,min:0 nu nuw=4 sbr=# list cpo+=n ts=4')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 " make sure, cache is invalidated!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 set ts=8
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 redraw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127 set ts=4
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128 redraw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129 let g:line=s:screenline(line('.'),10)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
130 let g:expect=" 2 ^Iabcd\n# opq\n# BCD\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
131 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
132 call s:close_windows('set sbr= cpo-=n')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
133 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
135 function Test_breakindent08a()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
136 " breakindent set and shift by 1, Number and list set sbr=# and briopt:sbr
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137 call s:testwindows('setl briopt=shift:1,sbr,min:0 nu nuw=4 sbr=# list')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
138 let g:line=s:screenline(line('.'),10)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
139 let g:expect=" 2 ^Iabcd\n # opq\n # BCD\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
140 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
141 call s:close_windows('set sbr=')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
142 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
143
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
144 function Test_breakindent09()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
145 " breakindent set and shift by 1, Number and list set sbr=#
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
146 call s:testwindows('setl briopt=shift:1,min:0 nu nuw=4 sbr=# list')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
147 let g:line=s:screenline(line('.'),10)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
148 let g:expect=" 2 ^Iabcd\n #op\n #AB\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
149 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
150 call s:close_windows('set sbr=')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
151 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
152
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
153 function Test_breakindent10()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
154 " breakindent set, Number set sbr=~
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
155 call s:testwindows('setl cpo+=n sbr=~ nu nuw=4 nolist briopt=sbr,min:0')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
156 " make sure, cache is invalidated!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
157 set ts=8
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
158 redraw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
159 set ts=4
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
160 redraw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
161 let g:line=s:screenline(line('.'),10)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
162 let g:expect=" 2 ab\n~ mn\n~ yz\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
163 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
164 call s:close_windows('set sbr= cpo-=n')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
165 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
166
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
167 function Test_breakindent11()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
168 " test strdisplaywidth()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
169 call s:testwindows('setl cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
170 let text=getline(2)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
171 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
172 call assert_equal(width, strdisplaywidth(text))
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
173 call s:close_windows('set sbr=')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
174 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
175
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
176 function Test_breakindent12()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
177 " test breakindent with long indent
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
178 let s:input="\t\t\t\t\t{"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
179 call s:testwindows('setl breakindent linebreak briopt=min:10 nu numberwidth=3 ts=4 list listchars=tab:>-')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
180 let g:line=s:screenline(2,16)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
181 let g:expect=" 2 >--->--->--->\n ---{ \n~ \n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
182 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
183 call s:close_windows('set nuw=4 listchars=')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
184 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
185
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
186 function Test_breakindent13()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
187 let s:input=""
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
188 call s:testwindows('setl breakindent briopt=min:10 ts=8')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
189 vert resize 20
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
190 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
191 1
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
192 norm! fbgj"ayl
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
193 2
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
194 norm! fygj"byl
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
195 call assert_equal('d', @a)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
196 call assert_equal('w', @b)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
197 call s:close_windows()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
198 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
199
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
200 function Test_breakindent14()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
201 let s:input=""
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
202 call s:testwindows('setl breakindent briopt= ts=8')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
203 vert resize 30
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
204 norm! 3a1234567890
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
205 norm! a abcde
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
206 exec "norm! 0\<C-V>tex"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
207 let g:line=s:screenline(line('.'),8)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
208 let g:expect="e \n~ \n~ \n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
209 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
210 call s:close_windows()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
211 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
212
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
213 function Test_breakindent15()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
214 let s:input=""
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
215 call s:testwindows('setl breakindent briopt= ts=8 sw=8')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
216 vert resize 30
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
217 norm! 4a1234567890
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
218 exe "normal! >>\<C-V>3f0x"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
219 let g:line=s:screenline(line('.'),20)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
220 let g:expect=" 1234567890 \n~ \n~ \n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
221 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
222 call s:close_windows()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
223 endfunction
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
224
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
225 function Test_breakindent16()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
226 " Check that overlong lines are indented correctly.
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
227 " TODO: currently it does not fail even when the bug is not fixed.
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
228 let s:input=""
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
229 call s:testwindows('setl breakindent briopt=min:0 ts=4')
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
230 call setline(1, "\t".repeat("1234567890", 10))
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
231 resize 6
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
232 norm! 1gg$
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
233 redraw!
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
234 let g:line=s:screenline(1,10)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
235 let g:expect=" 123456\n 789012\n 345678\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
236 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
237 let g:line=s:screenline(4,10)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
238 let g:expect=" 901234\n 567890\n 123456\n"
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
239 call assert_equal(g:expect, g:line)
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
240 call s:close_windows()
957a1d560bda commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
241 endfunction