annotate src/testdir/test_put.vim @ 33426:21287c90cc2c v9.0.1971

patch 9.0.1971: macOS: FEAT_SOUND guard too restrictive Commit: https://github.com/vim/vim/commit/f59cbefd0aa1cda7d3fd5fbd02678e82ee155ad1 Author: Yee Cheng Chin <ychin.git@gmail.com> Date: Mon Oct 2 21:28:50 2023 +0200 patch 9.0.1971: macOS: FEAT_SOUND guard too restrictive Problem: macOS: FEAT_SOUND guard too restrictive Solution: check for older macOS support properly Fix macOS FEAT_SOUND guards to be less restrictive This allows +sound to work on older macOS platforms again. The +sound implementation uses APIs available in 10.6, but the code itself uses generics with type parameters which was only added in Xcode 7 / clang 7, which was released for macOS 10.11. This means as long as Vim is compiled under 10.11+, and using a deployment target >= 10.6, the feature will work. closes: #13251 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Mon, 02 Oct 2023 21:45:04 +0200
parents c8b28054caec
children 8b0648002604
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
1 " Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc.
10664
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
25927
2e82629dbd90 patch 8.2.3497: put test fails when run by itself
Bram Moolenaar <Bram@vim.org>
parents: 25919
diff changeset
3 source check.vim
32288
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
4 source screendump.vim
25927
2e82629dbd90 patch 8.2.3497: put test fails when run by itself
Bram Moolenaar <Bram@vim.org>
parents: 25919
diff changeset
5
10664
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 func Test_put_block()
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 new
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x')
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 call feedkeys("\<C-V>y", 'x')
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call feedkeys("gg0p", 'x')
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 call assert_equal("\u2500x", getline(1))
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 bwipe!
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endfunc
10670
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
14
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
15 func Test_put_char_block()
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
16 new
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
17 call setline(1, ['Line 1', 'Line 2'])
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
18 f Xfile_put
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
19 " visually select both lines and put the cursor at the top of the visual
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
20 " selection and then put the buffer name over it
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
21 exe "norm! G0\<c-v>ke\"%p"
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
22 call assert_equal(['Xfile_put 1', 'Xfile_put 2'], getline(1,2))
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
23 bw!
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
24 endfunc
10688
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
25
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
26 func Test_put_char_block2()
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
27 new
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
28 call setreg('a', ' one ', 'v')
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
29 call setline(1, ['Line 1', '', 'Line 3', ''])
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
30 " visually select the first 3 lines and put register a over it
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
31 exe "norm! ggl\<c-v>2j2l\"ap"
21996
808edde1e97d patch 8.2.1547: various comment problems
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
32 call assert_equal(['L one 1', '', 'L one 3', ''], getline(1, 4))
10688
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
33 " clean up
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
34 bw!
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
35 endfunc
11597
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
36
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
37 func Test_put_lines()
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
38 new
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
39 let a = [ getreg('a'), getregtype('a') ]
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
40 call setline(1, ['Line 1', 'Line2', 'Line 3', ''])
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
41 exe 'norm! gg"add"AddG""p'
21996
808edde1e97d patch 8.2.1547: various comment problems
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
42 call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1, '$'))
11597
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
43 " clean up
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
44 bw!
18000
7a19c8d6bb9e patch 8.1.1996: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17857
diff changeset
45 eval a[0]->setreg('a', a[1])
11597
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
46 endfunc
14009
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
47
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
48 func Test_put_expr()
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
49 new
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
50 call setline(1, repeat(['A'], 6))
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
51 exec "1norm! \"=line('.')\<cr>p"
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
52 norm! j0.
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
53 norm! j0.
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
54 exec "4norm! \"=\<cr>P"
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
55 norm! j0.
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
56 norm! j0.
21996
808edde1e97d patch 8.2.1547: various comment problems
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
57 call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1, '$'))
14009
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
58 bw!
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
59 endfunc
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
60
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
61 func Test_put_fails_when_nomodifiable()
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
62 new
14204
1b9f3932a130 patch 8.1.0119: failing test goes unnoticed because messages is not written
Christian Brabandt <cb@256bit.org>
parents: 14202
diff changeset
63 setlocal nomodifiable
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
64
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
65 normal! yy
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
66 call assert_fails(':put', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
67 call assert_fails(':put!', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
68 call assert_fails(':normal! p', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
69 call assert_fails(':normal! gp', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
70 call assert_fails(':normal! P', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
71 call assert_fails(':normal! gP', 'E21:')
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
72
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
73 if has('mouse')
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
74 set mouse=n
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
75 call assert_fails('execute "normal! \<MiddleMouse>"', 'E21:')
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
76 set mouse&
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
77 endif
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
78
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
79 bwipeout!
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
80 endfunc
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
81
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
82 " A bug was discovered where the Normal mode put commands (e.g., "p") would
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
83 " output duplicate error messages when invoked in a non-modifiable buffer.
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
84 func Test_put_p_errmsg_nodup()
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
85 new
14204
1b9f3932a130 patch 8.1.0119: failing test goes unnoticed because messages is not written
Christian Brabandt <cb@256bit.org>
parents: 14202
diff changeset
86 setlocal nomodifiable
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
87
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
88 normal! yy
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
89
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
90 func Capture_p_error()
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
91 redir => s:p_err
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
92 normal! p
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
93 redir END
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
94 endfunc
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
95
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
96 silent! call Capture_p_error()
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
97
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
98 " Error message output within a function should be three lines (the function
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
99 " name, the line number, and the error message).
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
100 call assert_equal(3, count(s:p_err, "\n"))
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
101
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
102 delfunction Capture_p_error
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
103 bwipeout!
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
104 endfunc
16742
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
105
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
106 func Test_put_p_indent_visual()
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
107 new
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
108 call setline(1, ['select this text', 'select that text'])
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
109 " yank "that" from the second line
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
110 normal 2Gwvey
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
111 " select "this" in the first line and put
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
112 normal k0wve[p
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
113 call assert_equal('select that text', getline(1))
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
114 call assert_equal('select that text', getline(2))
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
115 bwipe!
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
116 endfunc
19625
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
117
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
118 " Test for deleting all the contents of a buffer with a put
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
119 func Test_put_visual_delete_all_lines()
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
120 new
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
121 call setline(1, ['one', 'two', 'three'])
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
122 let @r = ''
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
123 normal! VG"rgp
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
124 call assert_equal(1, line('$'))
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
125 close!
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
126 endfunc
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
127
25840
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
128 func Test_gp_with_count_leaves_cursor_at_end()
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
129 new
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
130 call setline(1, '<---->')
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
131 call setreg('@', "foo\nbar", 'c')
25842
196f75cf6983 patch 8.2.3455: using a count with "gp" leaves '] in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 25840
diff changeset
132 normal 1G3|3gp
196f75cf6983 patch 8.2.3455: using a count with "gp" leaves '] in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 25840
diff changeset
133 call assert_equal([0, 4, 4, 0], getpos("."))
196f75cf6983 patch 8.2.3455: using a count with "gp" leaves '] in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 25840
diff changeset
134 call assert_equal(['<--foo', 'barfoo', 'barfoo', 'bar-->'], getline(1, '$'))
196f75cf6983 patch 8.2.3455: using a count with "gp" leaves '] in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 25840
diff changeset
135 call assert_equal([0, 4, 3, 0], getpos("']"))
25840
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
136
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
137 bwipe!
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
138 endfunc
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
139
26012
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
140 func Test_p_with_count_leaves_mark_at_end()
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
141 new
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
142 call setline(1, '<---->')
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
143 call setreg('@', "start\nend", 'c')
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
144 normal 1G3|3p
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
145 call assert_equal([0, 1, 4, 0], getpos("."))
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
146 call assert_equal(['<--start', 'endstart', 'endstart', 'end-->'], getline(1, '$'))
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
147 call assert_equal([0, 4, 3, 0], getpos("']"))
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
148
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
149 bwipe!
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
150 endfunc
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
151
25919
db5b5c38d222 patch 8.2.3493: large count test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 25917
diff changeset
152 func Test_very_large_count()
26137
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
153 new
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
154 " total put-length (21474837 * 100) brings 32 bit int overflow
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
155 let @" = repeat('x', 100)
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
156 call assert_fails('norm 21474837p', 'E1240:')
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
157 bwipe!
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
158 endfunc
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
159
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
160 func Test_very_large_count_64bit()
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
161 if v:sizeoflong < 8
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
162 throw 'Skipped: only works with 64 bit long ints'
26087
945bdfc3c00f patch 8.2.3577: overflow check fails with 32 ints
Bram Moolenaar <Bram@vim.org>
parents: 26079
diff changeset
163 endif
945bdfc3c00f patch 8.2.3577: overflow check fails with 32 ints
Bram Moolenaar <Bram@vim.org>
parents: 26079
diff changeset
164
25917
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
165 new
26260
164db42130ec patch 8.2.3661: test for put with large count fails
Bram Moolenaar <Bram@vim.org>
parents: 26137
diff changeset
166 let @" = repeat('x', 100)
164db42130ec patch 8.2.3661: test for put with large count fails
Bram Moolenaar <Bram@vim.org>
parents: 26137
diff changeset
167 call assert_fails('norm 999999999p', 'E1240:')
25917
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
168 bwipe!
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
169 endfunc
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
170
26137
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
171 func Test_very_large_count_block()
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
172 new
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
173 " total put-length (21474837 * 100) brings 32 bit int overflow
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
174 call setline(1, repeat('x', 100))
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
175 exe "norm \<C-V>99ly"
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
176 call assert_fails('norm 21474837p', 'E1240:')
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
177 bwipe!
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
178 endfunc
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
179
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
180 func Test_very_large_count_block_64bit()
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
181 if v:sizeoflong < 8
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
182 throw 'Skipped: only works with 64 bit long ints'
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
183 endif
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
184
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
185 new
26260
164db42130ec patch 8.2.3661: test for put with large count fails
Bram Moolenaar <Bram@vim.org>
parents: 26137
diff changeset
186 call setline(1, repeat('x', 100))
164db42130ec patch 8.2.3661: test for put with large count fails
Bram Moolenaar <Bram@vim.org>
parents: 26137
diff changeset
187 exe "norm \<C-V>$y"
164db42130ec patch 8.2.3661: test for put with large count fails
Bram Moolenaar <Bram@vim.org>
parents: 26137
diff changeset
188 call assert_fails('norm 999999999p', 'E1240:')
26137
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
189 bwipe!
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
190 endfunc
14a55d1520f2 patch 8.2.3601: check for overflow in put count does not work well
Bram Moolenaar <Bram@vim.org>
parents: 26096
diff changeset
191
26096
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
192 func Test_put_above_first_line()
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
193 new
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
194 let @" = 'text'
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
195 silent! normal 0o00
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
196 0put
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
197 call assert_equal('text', getline(1))
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
198 bwipe!
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
199 endfunc
e353ace59e62 patch 8.2.3581: reading character past end of line
Bram Moolenaar <Bram@vim.org>
parents: 26087
diff changeset
200
26292
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
201 func Test_multibyte_op_end_mark()
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
202 new
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
203 call setline(1, 'ั‚ะตัั‚')
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
204 normal viwdp
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
205 call assert_equal([0, 1, 7, 0], getpos("'>"))
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
206 call assert_equal([0, 1, 7, 0], getpos("']"))
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
207
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
208 normal Vyp
26881
fb67cd7d30a7 patch 8.2.3969: value of MAXCOL not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents: 26292
diff changeset
209 call assert_equal([0, 1, v:maxcol, 0], getpos("'>"))
26292
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
210 call assert_equal([0, 2, 7, 0], getpos("']"))
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
211 bwipe!
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
212 endfunc
b79f122c6bd8 patch 8.2.3677: after a put the '] mark is on the last byte
Bram Moolenaar <Bram@vim.org>
parents: 26260
diff changeset
213
28988
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
214 " this was putting a mark before the start of a line
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
215 func Test_put_empty_register()
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
216 new
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
217 norm yy
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
218 norm [Pi00ggv)s0
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
219 sil! norm [P
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
220 bwipe!
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
221 endfunc
e6f486df5cc9 patch 8.2.5016: access before start of text with a put command
Bram Moolenaar <Bram@vim.org>
parents: 26881
diff changeset
222
29336
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
223 " this was putting the end mark after the end of the line
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
224 func Test_put_visual_mode()
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
225 edit! SomeNewBuffer
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
226 set selection=exclusive
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
227 exe "norm o\t"
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
228 m0
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
229 sil! norm  p p
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
230
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
231 bwipe!
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
232 set selection&
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
233 endfunc
575bc8eaa593 patch 9.0.0011: reading beyond the end of the line with put command
Bram Moolenaar <Bram@vim.org>
parents: 28988
diff changeset
234
32090
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
235 func Test_put_visual_block_mode()
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
236 enew
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
237 exe "norm 0R\<CR>\<C-C>V"
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
238 sil exe "norm \<C-V>c \<MiddleDrag>"
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
239 set ve=all
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
240 sil norm vz=p
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
241
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
242 bwipe!
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
243 set ve=
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
244 endfunc
327f8a3e0040 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Bram Moolenaar <Bram@vim.org>
parents: 29336
diff changeset
245
32288
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
246 func Test_put_other_window()
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
247 CheckRunVimInTerminal
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
248
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
249 let lines =<< trim END
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
250 40vsplit
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
251 0put ='some text at the top'
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
252 put =' one more text'
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
253 put =' two more text'
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
254 put =' three more text'
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
255 put =' four more text'
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
256 END
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
257 call writefile(lines, 'Xtest_put_other', 'D')
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
258 let buf = RunVimInTerminal('-S Xtest_put_other', #{rows: 10})
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
259
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
260 call VerifyScreenDump(buf, 'Test_put_other_window_1', {})
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
261
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
262 call StopVimInTerminal(buf)
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
263 endfunc
8201b0fcea02 patch 9.0.1476: lines put in non-current window are not displayed
Bram Moolenaar <Bram@vim.org>
parents: 32090
diff changeset
264
32531
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
265 func Test_put_in_last_displayed_line()
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
266 CheckRunVimInTerminal
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
267
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
268 let lines =<< trim END
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
269 vim9script
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
270 autocmd CursorMoved * eval line('w$')
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
271 @a = 'x'->repeat(&columns * 2 - 2)
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
272 range(&lines)->setline(1)
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
273 feedkeys('G"ap')
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
274 END
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
275 call writefile(lines, 'Xtest_put_last_line', 'D')
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
276 let buf = RunVimInTerminal('-S Xtest_put_last_line', #{rows: 10})
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
277
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
278 call VerifyScreenDump(buf, 'Test_put_in_last_displayed_line_1', {})
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
279
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
280 call StopVimInTerminal(buf)
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
281 endfunc
c8b28054caec patch 9.0.1597: cursor ends up below the window after a put
Bram Moolenaar <Bram@vim.org>
parents: 32288
diff changeset
282
25917
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
283
19625
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
284 " vim: shiftwidth=2 sts=2 expandtab