local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local os = require('os')
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local command = helpers.command
local eval, exc_exec = helpers.eval, helpers.exc_exec
local feed_command, eq = helpers.feed_command, helpers.eq
local curbufmeths = helpers.curbufmeths
describe('colorscheme compatibility', function()
before_each(function()
clear()
end)
it('t_Co is set to 256 by default', function()
eq('256', eval('&t_Co'))
end)
end)
describe('highlight: `:syntax manual`', function()
-- When using manual syntax highlighting, it should be preserved even when
-- switching buffers... bug did only occur without :set hidden
-- Ref: vim patch 7.4.1236
local screen
before_each(function()
clear()
screen = Screen.new(20,5)
screen:attach()
--syntax highlight for vimcscripts "echo"
screen:set_default_attr_ids( {
[0] = {bold=true, foreground=Screen.colors.Blue},
[1] = {bold=true, foreground=Screen.colors.Brown}
} )
end)
after_each(function()
screen:detach()
os.remove('Xtest-functional-ui-highlight.tmp.vim')
end)
it("works with buffer switch and 'hidden'", function()
command('e tmp1.vim')
command('e Xtest-functional-ui-highlight.tmp.vim')
command('filetype on')
command('syntax manual')
command('set ft=vim')
command('set syntax=ON')
feed('iecho 1<esc>0')
command('set hidden')
command('w')
command('bn')
feed_command('bp')
screen:expect([[
{1:^echo} 1 |
{0:~ }|
|