aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/066_visual_block_tab_spec.lua
blob: 72fa7d881b41c8599302643400980ab32d536696 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- vim: set foldmethod=marker foldmarker=[[,]] :
-- Test for visual block shift and tab characters.

local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

describe('visual block shift and tab characters', function()
  setup(clear)

  it('is working', function()
    insert([[
      one two three
      one two three
      one two three
      one two three
      one two three
      
      abcdefghijklmnopqrstuvwxyz
      abcdefghijklmnopqrstuvwxyz
      abcdefghijklmnopqrstuvwxyz
      abcdefghijklmnopqrstuvwxyz
      abcdefghijklmnopqrstuvwxyz]])

    feed('gg')
    feed([[fe<C-v>4jR<esc>ugvr1:'<lt>,'>yank A<cr>]])
    execute('/^abcdefgh')
    feed('<C-v>4jI    <esc>j<lt><lt>11|D')
    feed('j7|a		<esc>')
    feed('j7|a		   <esc>')
    feed('j7|a	       	<esc>4k13|<C-v>4j<lt>')
    execute('$-5,$yank A')
    execute([[$-4,$s/\s\+//g]])
    feed('<C-v>4kI    <esc>j<lt><lt>')
    feed('j7|a		<esc>')
    feed('j7|a					<esc>')
    feed('j7|a	       		<esc>4k13|<C-v>4j3<lt>')
    execute('$-4,$yank A')

    -- Put @a and clean empty lines
    execute('%d')
    execute('0put a')
    execute('$d')

    -- Assert buffer contents.
    expect([[
      on1 two three
      on1 two three
      on1 two three
      on1 two three
      on1 two three
      
          abcdefghijklmnopqrstuvwxyz
      abcdefghij
          abc	    defghijklmnopqrstuvwxyz
          abc	    defghijklmnopqrstuvwxyz
          abc	    defghijklmnopqrstuvwxyz
          abcdefghijklmnopqrstuvwxyz
      abcdefghij
          abc	    defghijklmnopqrstuvwxyz
          abc		defghijklmnopqrstuvwxyz
          abc	    defghijklmnopqrstuvwxyz]])
  end)
end)