annotate src/testdir/test_registers.vim @ 15062:3a94f7918980 v8.1.0542

patch 8.1.0542: shiftwidth() does not take 'vartabstop' into account commit https://github.com/vim/vim/commit/f951416a8396a54bbbe21de1a8b16716428549f2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 22 03:08:29 2018 +0100 patch 8.1.0542: shiftwidth() does not take 'vartabstop' into account Problem: shiftwidth() does not take 'vartabstop' into account. Solution: Use the cursor position or a position explicitly passed. Also make >> and << work better with 'vartabstop'. (Christian Brabandt)
author Bram Moolenaar <Bram@vim.org>
date Thu, 22 Nov 2018 03:15:10 +0100
parents 536874138ecd
children 29de75f53b1a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11682
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 func Test_yank_shows_register()
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 enew
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 set report=0
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 call setline(1, ['foo', 'bar'])
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " Line-wise
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 exe 'norm! yy'
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call assert_equal('1 line yanked', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 exe 'norm! "zyy'
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call assert_equal('1 line yanked into "z', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 exe 'norm! yj'
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 call assert_equal('2 lines yanked', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 exe 'norm! "zyj'
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call assert_equal('2 lines yanked into "z', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 " Block-wise
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 exe "norm! \<C-V>y"
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call assert_equal('block of 1 line yanked', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 exe "norm! \<C-V>\"zy"
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 call assert_equal('block of 1 line yanked into "z', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 exe "norm! \<C-V>jy"
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_equal('block of 2 lines yanked', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 exe "norm! \<C-V>j\"zy"
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal('block of 2 lines yanked into "z', v:statusmsg)
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 bwipe!
b9928ef8632f patch 8.0.0724: the message for yanking doesn't indicate the register
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 endfunc
13855
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
28
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
29 func Test_display_registers()
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
30 e file1
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
31 e file2
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
32 call setline(1, ['foo', 'bar'])
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
33 /bar
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
34 exe 'norm! y2l"axx'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
35 call feedkeys("i\<C-R>=2*4\n\<esc>")
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
36 call feedkeys(":ls\n", 'xt')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
37
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
38 let a = execute('display')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
39 let b = execute('registers')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
40
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
41 call assert_equal(a, b)
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
42 call assert_match('^\n--- Registers ---\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
43 \ . '"" a\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
44 \ . '"0 ba\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
45 \ . '"1 b\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
46 \ . '"a b\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
47 \ . '.*'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
48 \ . '"- a\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
49 \ . '.*'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
50 \ . '": ls\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
51 \ . '"% file2\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
52 \ . '"# file1\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
53 \ . '"/ bar\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
54 \ . '"= 2\*4', a)
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
55
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
56 let a = execute('registers a')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
57 call assert_match('^\n--- Registers ---\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
58 \ . '"a b', a)
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
59
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
60 let a = execute('registers :')
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
61 call assert_match('^\n--- Registers ---\n'
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
62 \ . '": ls', a)
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
63
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
64 bwipe!
536874138ecd patch 8.0.1799: no test for :registers command
Christian Brabandt <cb@256bit.org>
parents: 11682
diff changeset
65 endfunc