2014-11-08 12:08:42 -07:00
|
|
|
-- vim: set foldmethod=marker foldmarker=[[,]] :
|
|
|
|
-- Test for visual block shift and tab characters.
|
|
|
|
|
2024-04-20 08:44:13 -07:00
|
|
|
local n = require('test.functional.testnvim')()
|
|
|
|
|
|
|
|
local clear, feed, insert = n.clear, n.feed, n.insert
|
|
|
|
local feed_command, expect = n.feed_command, n.expect
|
2014-11-08 12:08:42 -07:00
|
|
|
|
|
|
|
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
|
2017-09-24 11:42:48 -07:00
|
|
|
|
2014-11-08 12:08:42 -07:00
|
|
|
abcdefghijklmnopqrstuvwxyz
|
|
|
|
abcdefghijklmnopqrstuvwxyz
|
|
|
|
abcdefghijklmnopqrstuvwxyz
|
|
|
|
abcdefghijklmnopqrstuvwxyz
|
|
|
|
abcdefghijklmnopqrstuvwxyz]])
|
|
|
|
|
|
|
|
feed('gg')
|
2014-12-14 05:20:07 -07:00
|
|
|
feed([[fe<C-v>4jR<esc>ugvr1:'<lt>,'>yank A<cr>]])
|
2017-04-08 14:12:26 -07:00
|
|
|
feed_command('/^abcdefgh')
|
2014-12-14 05:20:07 -07:00
|
|
|
feed('<C-v>4jI <esc>j<lt><lt>11|D')
|
2014-11-08 12:08:42 -07:00
|
|
|
feed('j7|a <esc>')
|
|
|
|
feed('j7|a <esc>')
|
2014-12-14 05:20:07 -07:00
|
|
|
feed('j7|a <esc>4k13|<C-v>4j<lt>')
|
2017-04-08 14:12:26 -07:00
|
|
|
feed_command('$-5,$yank A')
|
|
|
|
feed_command([[$-4,$s/\s\+//g]])
|
2014-12-14 05:20:07 -07:00
|
|
|
feed('<C-v>4kI <esc>j<lt><lt>')
|
2014-11-08 12:08:42 -07:00
|
|
|
feed('j7|a <esc>')
|
|
|
|
feed('j7|a <esc>')
|
2014-12-14 05:20:07 -07:00
|
|
|
feed('j7|a <esc>4k13|<C-v>4j3<lt>')
|
2017-04-08 14:12:26 -07:00
|
|
|
feed_command('$-4,$yank A')
|
2014-11-08 12:08:42 -07:00
|
|
|
|
|
|
|
-- Put @a and clean empty lines
|
2017-04-08 14:12:26 -07:00
|
|
|
feed_command('%d')
|
|
|
|
feed_command('0put a')
|
|
|
|
feed_command('$d')
|
2014-11-08 12:08:42 -07:00
|
|
|
|
|
|
|
-- Assert buffer contents.
|
|
|
|
expect([[
|
|
|
|
on1 two three
|
|
|
|
on1 two three
|
|
|
|
on1 two three
|
|
|
|
on1 two three
|
|
|
|
on1 two three
|
2017-09-24 11:42:48 -07:00
|
|
|
|
2014-11-08 12:08:42 -07:00
|
|
|
abcdefghijklmnopqrstuvwxyz
|
|
|
|
abcdefghij
|
|
|
|
abc defghijklmnopqrstuvwxyz
|
|
|
|
abc defghijklmnopqrstuvwxyz
|
|
|
|
abc defghijklmnopqrstuvwxyz
|
|
|
|
abcdefghijklmnopqrstuvwxyz
|
|
|
|
abcdefghij
|
|
|
|
abc defghijklmnopqrstuvwxyz
|
|
|
|
abc defghijklmnopqrstuvwxyz
|
|
|
|
abc defghijklmnopqrstuvwxyz]])
|
|
|
|
end)
|
|
|
|
end)
|