local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local feed = helpers.feed
local clear = helpers.clear
local command = helpers.command
local insert = helpers.insert
local write_file = helpers.write_file
local dedent = helpers.dedent
local exec = helpers.exec
local eq = helpers.eq
local api = helpers.api
before_each(clear)
describe('Diff mode screen', function()
local fname = 'Xtest-functional-diff-screen-1'
local fname_2 = fname .. '.2'
local screen
local reread = function()
feed(':e<cr><c-w>w:e<cr><c-w>w')
end
setup(function()
os.remove(fname)
os.remove(fname_2)
end)
teardown(function()
os.remove(fname)
os.remove(fname_2)
end)
before_each(function()
feed(':e ' .. fname_2 .. '<cr>')
feed(':vnew ' .. fname .. '<cr>')
feed(':diffthis<cr>')
feed('<c-w>w:diffthis<cr><c-w>w')
screen = Screen.new(40, 16)
screen:attach()
screen:set_default_attr_ids({
[1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
[2] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
[3] = { reverse = true },
[4] = { background = Screen.colors.LightBlue },
[5] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey },
[6] = { bold = true, foreground = Screen.colors.Blue1 },
[7] = { bold = true, reverse = true },
[8] = { bold = true, background = Screen.colors.Red },
[9] = { background = Screen.colors.LightMagenta },
})
end)
it('Add a line in beginning of file 2', function()
write_file(fname, '1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n', false)
write_file(fname_2, '0\n1
|