2014-10-27 12:27:20 -07:00
|
|
|
|
-- Test for sourcing a file with CTRL-V's at the end of the line
|
|
|
|
|
|
2016-04-23 16:53:11 -07:00
|
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
2014-10-27 12:27:20 -07:00
|
|
|
|
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
2017-04-08 14:12:26 -07:00
|
|
|
|
local feed_command, expect = helpers.feed_command, helpers.expect
|
2014-10-27 12:27:20 -07:00
|
|
|
|
|
|
|
|
|
describe('CTRL-V at the end of the line', function()
|
|
|
|
|
setup(clear)
|
|
|
|
|
|
|
|
|
|
it('is working', function()
|
|
|
|
|
insert([[
|
|
|
|
|
firstline
|
|
|
|
|
map __1 afirst
|
|
|
|
|
map __2 asecond
|
|
|
|
|
map __3 athird
|
|
|
|
|
map __4 afourth
|
|
|
|
|
map __5 afifth
|
|
|
|
|
map __1 asdX
|
|
|
|
|
map __2 asdXX
|
|
|
|
|
map __3 asdXX
|
|
|
|
|
map __4 asdXXX
|
|
|
|
|
map __5 asdXXX
|
|
|
|
|
lastline]])
|
|
|
|
|
|
|
|
|
|
feed(':%s/X/<C-v><C-v>/g<cr>')
|
|
|
|
|
feed(':/firstline/+1,/lastline/-1w! Xtestfile<cr>')
|
2017-04-08 14:12:26 -07:00
|
|
|
|
feed_command('so Xtestfile')
|
|
|
|
|
feed_command('%d')
|
2014-10-27 12:27:20 -07:00
|
|
|
|
feed('Gmm__1<Esc><Esc>__2<Esc>__3<Esc><Esc>__4<Esc>__5<Esc>')
|
|
|
|
|
feed(":'m,$s/<C-v><C-@>/0/g<cr>")
|
|
|
|
|
|
|
|
|
|
expect([[
|
|
|
|
|
sd
|
|
|
|
|
map __2 asdsecondsdsd0map __5 asd0fifth]])
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
teardown(function()
|
|
|
|
|
os.remove('Xtestfile')
|
|
|
|
|
end)
|
|
|
|
|
end)
|