annotate src/testdir/test_visual.vim @ 15607:2dcaa860e3fc v8.1.0811

patch 8.1.0811: too many #ifdefs commit https://github.com/vim/vim/commit/30276f2beb248557c6b33cd5418bca8b7084b0a5 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 24 17:59:39 2019 +0100 patch 8.1.0811: too many #ifdefs Problem: Too many #ifdefs. Solution: Graduate FEAT_MBYTE, the final chapter.
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jan 2019 18:00:07 +0100
parents 2c44001e7e13
children e91750e8adb5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10494
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
1 " Tests for various Visual mode.
8401
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 if !has('visual')
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 finish
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 endif
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
11091
ae45d497868f patch 8.0.0433: beeps when running tests
Christian Brabandt <cb@256bit.org>
parents: 10900
diff changeset
6
8401
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 func Test_block_shift_multibyte()
10494
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
8 " Uses double-wide character.
8401
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 split
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call setline(1, ['xヹxxx', 'ヹxxx'])
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 exe "normal 1G0l\<C-V>jl>"
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 call assert_equal('x ヹxxx', getline(1))
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 call assert_equal(' ヹxxx', getline(2))
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 q!
98955c2ffd9f commit https://github.com/vim/vim/commit/019b9c644e92742e37efc08fef47c2620a01b6b3
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 endfunc
10494
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
16
11997
66b677c77467 patch 8.0.0879: crash when shifting with huge number
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
17 func Test_block_shift_overflow()
66b677c77467 patch 8.0.0879: crash when shifting with huge number
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
18 " This used to cause a multiplication overflow followed by a crash.
66b677c77467 patch 8.0.0879: crash when shifting with huge number
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
19 new
66b677c77467 patch 8.0.0879: crash when shifting with huge number
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
20 normal ii
66b677c77467 patch 8.0.0879: crash when shifting with huge number
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
21 exe "normal \<C-V>876543210>"
66b677c77467 patch 8.0.0879: crash when shifting with huge number
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
22 q!
66b677c77467 patch 8.0.0879: crash when shifting with huge number
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
23 endfunc
66b677c77467 patch 8.0.0879: crash when shifting with huge number
Christian Brabandt <cb@256bit.org>
parents: 11091
diff changeset
24
10494
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
25 func Test_dotregister_paste()
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
26 new
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
27 exe "norm! ihello world\<esc>"
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
28 norm! 0ve".p
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
29 call assert_equal('hello world world', getline(1))
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
30 q!
1e700d72561d commit https://github.com/vim/vim/commit/f8eb9c51e5bbd10e59c9b1247f8f6c7f5b77ccd0
Christian Brabandt <cb@256bit.org>
parents: 9618
diff changeset
31 endfunc
10803
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
32
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
33 func Test_Visual_ctrl_o()
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
34 new
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
35 call setline(1, ['one', 'two', 'three'])
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
36 call cursor(1,2)
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
37 set noshowmode
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
38 set tw=0
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
39 call feedkeys("\<c-v>jjlIa\<c-\>\<c-o>:set tw=88\<cr>\<esc>", 'tx')
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
40 call assert_equal(['oane', 'tawo', 'tahree'], getline(1, 3))
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
41 call assert_equal(88, &tw)
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
42 set tw&
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
43 bw!
065da86ca6d2 patch 8.0.0291: Visual block insertion does not insert in all lines
Christian Brabandt <cb@256bit.org>
parents: 10494
diff changeset
44 endfu
10881
8f6df2f6d2fc patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents: 10803
diff changeset
45
8f6df2f6d2fc patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents: 10803
diff changeset
46 func Test_Visual_vapo()
8f6df2f6d2fc patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents: 10803
diff changeset
47 new
8f6df2f6d2fc patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents: 10803
diff changeset
48 normal oxx
8f6df2f6d2fc patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents: 10803
diff changeset
49 normal vapo
8f6df2f6d2fc patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents: 10803
diff changeset
50 bwipe!
8f6df2f6d2fc patch 8.0.0330: illegal memory access after "vapo"
Christian Brabandt <cb@256bit.org>
parents: 10803
diff changeset
51 endfunc
10900
9b4574d95571 patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents: 10881
diff changeset
52
9b4574d95571 patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents: 10881
diff changeset
53 func Test_Visual_inner_quote()
9b4574d95571 patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents: 10881
diff changeset
54 new
9b4574d95571 patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents: 10881
diff changeset
55 normal oxX
9b4574d95571 patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents: 10881
diff changeset
56 normal vki'
9b4574d95571 patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents: 10881
diff changeset
57 bwipe!
9b4574d95571 patch 8.0.0339: illegal memory access with vi'
Christian Brabandt <cb@256bit.org>
parents: 10881
diff changeset
58 endfunc
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
59
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
60 " Test for Visual mode not being reset causing E315 error.
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
61 func TriggerTheProblem()
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
62 " At this point there is no visual selection because :call reset it.
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
63 " Let's restore the selection:
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
64 normal gv
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
65 '<,'>del _
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
66 try
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
67 exe "normal \<Esc>"
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
68 catch /^Vim\%((\a\+)\)\=:E315/
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
69 echom 'Snap! E315 error!'
13402
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
70 let g:msg = 'Snap! E315 error!'
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
71 endtry
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
72 endfunc
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
73
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
74 func Test_visual_mode_reset()
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
75 enew
13402
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
76 let g:msg = "Everything's fine."
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
77 enew
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
78 setl buftype=nofile
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
79 call append(line('$'), 'Delete this line.')
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
80
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
81 " NOTE: this has to be done by a call to a function because executing :del
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
82 " the ex-way will require the colon operator which resets the visual mode
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
83 " thus preventing the problem:
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
84 exe "normal! GV:call TriggerTheProblem()\<CR>"
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
85 call assert_equal("Everything's fine.", g:msg)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
86
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11997
diff changeset
87 endfunc
12644
1fad9675d8fd patch 8.0.1200: tests switch the bell off twice
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
88
12686
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
89 " Test for visual block shift and tab characters.
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
90 func Test_block_shift_tab()
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
91 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
92 call append(0, repeat(['one two three'], 5))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
93 call cursor(1,1)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
94 exe "normal i\<C-G>u"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
95 exe "normal fe\<C-V>4jR\<Esc>ugvr1"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
96 call assert_equal('on1 two three', getline(1))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
97 call assert_equal('on1 two three', getline(2))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
98 call assert_equal('on1 two three', getline(5))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
99
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
100 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
101 call append(0, repeat(['abcdefghijklmnopqrstuvwxyz'], 5))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
102 call cursor(1,1)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
103 exe "normal \<C-V>4jI \<Esc>j<<11|D"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
104 exe "normal j7|a\<Tab>\<Tab>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
105 exe "normal j7|a\<Tab>\<Tab> "
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
106 exe "normal j7|a\<Tab> \<Tab>\<Esc>4k13|\<C-V>4j<"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
107 call assert_equal(' abcdefghijklmnopqrstuvwxyz', getline(1))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
108 call assert_equal('abcdefghij', getline(2))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
109 call assert_equal(" abc\<Tab> defghijklmnopqrstuvwxyz", getline(3))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
110 call assert_equal(" abc\<Tab> defghijklmnopqrstuvwxyz", getline(4))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
111 call assert_equal(" abc\<Tab> defghijklmnopqrstuvwxyz", getline(5))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
112
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
113 %s/\s\+//g
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
114 call cursor(1,1)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
115 exe "normal \<C-V>4jI \<Esc>j<<"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
116 exe "normal j7|a\<Tab>\<Tab>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
117 exe "normal j7|a\<Tab>\<Tab>\<Tab>\<Tab>\<Tab>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
118 exe "normal j7|a\<Tab> \<Tab>\<Tab>\<Esc>4k13|\<C-V>4j3<"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
119 call assert_equal(' abcdefghijklmnopqrstuvwxyz', getline(1))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
120 call assert_equal('abcdefghij', getline(2))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
121 call assert_equal(" abc\<Tab> defghijklmnopqrstuvwxyz", getline(3))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
122 call assert_equal(" abc\<Tab>\<Tab>defghijklmnopqrstuvwxyz", getline(4))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
123 call assert_equal(" abc\<Tab> defghijklmnopqrstuvwxyz", getline(5))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
124
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
125 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
126 endfunc
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
127
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
128 " Tests Blockwise Visual when there are TABs before the text.
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
129 func Test_blockwise_visual()
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
130 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
131 call append(0, ['123456',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
132 \ '234567',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
133 \ '345678',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
134 \ '',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
135 \ 'test text test tex start here',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
136 \ "\t\tsome text",
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
137 \ "\t\ttest text",
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
138 \ 'test text'])
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
139 call cursor(1,1)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
140 exe "normal /start here$\<CR>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
141 exe 'normal "by$' . "\<C-V>jjlld"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
142 exe "normal /456$\<CR>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
143 exe "normal \<C-V>jj" . '"bP'
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
144 call assert_equal(['123start here56',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
145 \ '234start here67',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
146 \ '345start here78',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
147 \ '',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
148 \ 'test text test tex rt here',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
149 \ "\t\tsomext",
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
150 \ "\t\ttesext"], getline(1, 7))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
151
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
152 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
153 endfunc
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
154
13978
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
155 " Test swapping corners in blockwise visual mode with o and O
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
156 func Test_blockwise_visual_o_O()
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
157 enew!
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
158
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
159 exe "norm! 10i.\<Esc>Y4P3lj\<C-V>4l2jr "
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
160 exe "norm! gvO\<Esc>ra"
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
161 exe "norm! gvO\<Esc>rb"
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
162 exe "norm! gvo\<C-c>rc"
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
163 exe "norm! gvO\<C-c>rd"
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
164
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
165 call assert_equal(['..........',
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
166 \ '...c d..',
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
167 \ '... ..',
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
168 \ '...a b..',
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
169 \ '..........'], getline(1, '$'))
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
170
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
171 enew!
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
172 endfun
81c324144452 patch 8.1.0007: no test for "o" and "O" in Visual block mode
Christian Brabandt <cb@256bit.org>
parents: 13410
diff changeset
173
12686
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
174 " Test Virtual replace mode.
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
175 func Test_virtual_replace()
13410
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
176 if exists('&t_kD')
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
177 let save_t_kD = &t_kD
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
178 endif
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
179 if exists('&t_kb')
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
180 let save_t_kb = &t_kb
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
181 endif
12686
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
182 exe "set t_kD=\<C-V>x7f t_kb=\<C-V>x08"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
183 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
184 exe "normal a\nabcdefghi\njk\tlmn\n opq rst\n\<C-D>uvwxyz"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
185 call cursor(1,1)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
186 set ai bs=2
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
187 exe "normal gR0\<C-D> 1\nA\nBCDEFGHIJ\n\tKL\nMNO\nPQR"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
188 call assert_equal([' 1',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
189 \ ' A',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
190 \ ' BCDEFGHIJ',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
191 \ ' KL',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
192 \ ' MNO',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
193 \ ' PQR',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
194 \ ], getline(1, 6))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
195 normal G
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
196 mark a
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
197 exe "normal o0\<C-D>\nabcdefghi\njk\tlmn\n opq\trst\n\<C-D>uvwxyz\n"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
198 exe "normal 'ajgR0\<C-D> 1\nA\nBCDEFGHIJ\n\tKL\nMNO\nPQR" . repeat("\<BS>", 29)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
199 call assert_equal([' 1',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
200 \ 'abcdefghi',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
201 \ 'jk lmn',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
202 \ ' opq rst',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
203 \ 'uvwxyz'], getline(7, 11))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
204 normal G
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
205 exe "normal iab\tcdefghi\tjkl"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
206 exe "normal 0gRAB......CDEFGHI.J\<Esc>o"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
207 exe "normal iabcdefghijklmnopqrst\<Esc>0gRAB\tIJKLMNO\tQR"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
208 call assert_equal(['AB......CDEFGHI.Jkl',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
209 \ 'AB IJKLMNO QRst'], getline(12, 13))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
210 enew!
13406
4e30f3f4cb78 patch 8.0.1577: virtual replace test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 13402
diff changeset
211 set noai bs&vim
13410
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
212 if exists('save_t_kD')
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
213 let &t_kD = save_t_kD
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
214 endif
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
215 if exists('save_t_kb')
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
216 let &t_kb = save_t_kb
c571356c65bd patch 8.0.1579: virtual replace test fails in GUI
Christian Brabandt <cb@256bit.org>
parents: 13406
diff changeset
217 endif
12686
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12644
diff changeset
218 endfunc
13402
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
219
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
220 " Test Virtual replace mode.
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
221 func Test_virtual_replace2()
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
222 enew!
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
223 set bs=2
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
224 exe "normal a\nabcdefghi\njk\tlmn\n opq rst\n\<C-D>uvwxyz"
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
225 call cursor(1,1)
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
226 " Test 1: Test that del deletes the newline
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
227 exe "normal gR0\<del> 1\nA\nBCDEFGHIJ\n\tKL\nMNO\nPQR"
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
228 call assert_equal(['0 1',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
229 \ 'A',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
230 \ 'BCDEFGHIJ',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
231 \ ' KL',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
232 \ 'MNO',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
233 \ 'PQR',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
234 \ ], getline(1, 6))
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
235 " Test 2:
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
236 " a newline is not deleted, if no newline has been added in virtual replace mode
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
237 %d_
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
238 call setline(1, ['abcd', 'efgh', 'ijkl'])
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
239 call cursor(2,1)
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
240 exe "norm! gR1234\<cr>5\<bs>\<bs>\<bs>"
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
241 call assert_equal(['abcd',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
242 \ '123h',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
243 \ 'ijkl'], getline(1, '$'))
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
244 " Test 3:
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
245 " a newline is deleted, if a newline has been inserted before in virtual replace mode
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
246 %d_
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
247 call setline(1, ['abcd', 'efgh', 'ijkl'])
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
248 call cursor(2,1)
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
249 exe "norm! gR1234\<cr>\<cr>56\<bs>\<bs>\<bs>"
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
250 call assert_equal(['abcd',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
251 \ '1234',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
252 \ 'ijkl'], getline(1, '$'))
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
253 " Test 4:
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
254 " delete add a newline, delete it, add it again and check undo
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
255 %d_
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
256 call setline(1, ['abcd', 'efgh', 'ijkl'])
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
257 call cursor(2,1)
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
258 " break undo sequence explicitly
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
259 let &ul = &ul
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
260 exe "norm! gR1234\<cr>\<bs>\<del>56\<cr>"
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
261 let &ul = &ul
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
262 call assert_equal(['abcd',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
263 \ '123456',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
264 \ ''], getline(1, '$'))
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
265 norm! u
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
266 call assert_equal(['abcd',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
267 \ 'efgh',
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
268 \ 'ijkl'], getline(1, '$'))
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
269 " clean up
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
270 %d_
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
271 set bs&vim
338b15c63e2c patch 8.0.1575: crash when using virtual replace
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
272 endfunc
15359
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
273
15462
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
274 func Test_Visual_word_textobject()
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
275 new
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
276 call setline(1, ['First sentence. Second sentence.'])
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
277
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
278 " When start and end of visual area are identical, 'aw' or 'iw' select
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
279 " the whole word.
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
280 norm! 1go2fcvawy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
281 call assert_equal('Second ', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
282 norm! 1go2fcviwy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
283 call assert_equal('Second', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
284
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
285 " When start and end of visual area are not identical, 'aw' or 'iw'
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
286 " extend the word in direction of the end of the visual area.
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
287 norm! 1go2fcvlawy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
288 call assert_equal('cond ', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
289 norm! gv2awy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
290 call assert_equal('cond sentence.', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
291
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
292 norm! 1go2fcvliwy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
293 call assert_equal('cond', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
294 norm! gv2iwy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
295 call assert_equal('cond sentence', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
296
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
297 " Extend visual area in opposite direction.
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
298 norm! 1go2fcvhawy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
299 call assert_equal(' Sec', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
300 norm! gv2awy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
301 call assert_equal(' sentence. Sec', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
302
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
303 norm! 1go2fcvhiwy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
304 call assert_equal('Sec', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
305 norm! gv2iwy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
306 call assert_equal('. Sec', @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
307
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
308 bwipe!
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
309 endfunc
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
310
15359
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
311 func Test_Visual_sentence_textobject()
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
312 new
15462
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
313 call setline(1, ['First sentence. Second sentence. Third', 'sentence. Fourth sentence'])
15359
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
314
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
315 " When start and end of visual area are identical, 'as' or 'is' select
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
316 " the whole sentence.
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
317 norm! 1gofdvasy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
318 call assert_equal('Second sentence. ', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
319 norm! 1gofdvisy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
320 call assert_equal('Second sentence.', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
321
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
322 " When start and end of visual area are not identical, 'as' or 'is'
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
323 " extend the sentence in direction of the end of the visual area.
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
324 norm! 1gofdvlasy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
325 call assert_equal('d sentence. ', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
326 norm! gvasy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
327 call assert_equal("d sentence. Third\nsentence. ", @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
328
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
329 norm! 1gofdvlisy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
330 call assert_equal('d sentence.', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
331 norm! gvisy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
332 call assert_equal('d sentence. ', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
333 norm! gvisy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
334 call assert_equal("d sentence. Third\nsentence.", @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
335
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
336 " Extend visual area in opposite direction.
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
337 norm! 1gofdvhasy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
338 call assert_equal(' Second', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
339 norm! gvasy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
340 call assert_equal("First sentence. Second", @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
341
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
342 norm! 1gofdvhisy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
343 call assert_equal('Second', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
344 norm! gvisy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
345 call assert_equal(' Second', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
346 norm! gvisy
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
347 call assert_equal('First sentence. Second', @")
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
348
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
349 bwipe!
bdf5f546eba0 patch 8.1.0687: sentence text object in Visual mode is not tested
Bram Moolenaar <Bram@vim.org>
parents: 13978
diff changeset
350 endfunc
15462
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
351
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
352 func Test_Visual_paragraph_textobject()
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
353 new
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
354 call setline(1, ['First line.',
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
355 \ '',
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
356 \ 'Second line.',
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
357 \ 'Third line.',
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
358 \ 'Fourth line.',
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
359 \ 'Fifth line.',
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
360 \ '',
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
361 \ 'Sixth line.'])
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
362
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
363 " When start and end of visual area are identical, 'ap' or 'ip' select
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
364 " the whole paragraph.
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
365 norm! 4ggvapy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
366 call assert_equal("Second line.\nThird line.\nFourth line.\nFifth line.\n\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
367 norm! 4ggvipy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
368 call assert_equal("Second line.\nThird line.\nFourth line.\nFifth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
369
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
370 " When start and end of visual area are not identical, 'ap' or 'ip'
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
371 " extend the sentence in direction of the end of the visual area.
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
372 " FIXME: actually, it is not sufficient to have different start and
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
373 " end of visual selection, the start line and end line have to differ,
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
374 " which is not consistent with the documentation.
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
375 norm! 4ggVjapy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
376 call assert_equal("Third line.\nFourth line.\nFifth line.\n\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
377 norm! gvapy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
378 call assert_equal("Third line.\nFourth line.\nFifth line.\n\nSixth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
379 norm! 4ggVjipy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
380 call assert_equal("Third line.\nFourth line.\nFifth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
381 norm! gvipy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
382 call assert_equal("Third line.\nFourth line.\nFifth line.\n\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
383 norm! gvipy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
384 call assert_equal("Third line.\nFourth line.\nFifth line.\n\nSixth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
385
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
386 " Extend visual area in opposite direction.
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
387 norm! 5ggVkapy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
388 call assert_equal("\nSecond line.\nThird line.\nFourth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
389 norm! gvapy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
390 call assert_equal("First line.\n\nSecond line.\nThird line.\nFourth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
391 norm! 5ggVkipy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
392 call assert_equal("Second line.\nThird line.\nFourth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
393 norma gvipy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
394 call assert_equal("\nSecond line.\nThird line.\nFourth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
395 norm! gvipy
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
396 call assert_equal("First line.\n\nSecond line.\nThird line.\nFourth line.\n", @")
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
397
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
398 bwipe!
2c44001e7e13 patch 8.1.0739: text objects in not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15359
diff changeset
399 endfunc