mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 01:09:56 +10:00
Merge pull request #4540 from KillTheMule/vim-patch-1236
vim-patch: 7.4.1236
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
local helpers = require('test.functional.helpers')
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local os = require('os')
|
||||
local clear, feed = helpers.clear, helpers.feed
|
||||
local execute, request, eq = helpers.execute, helpers.request, helpers.eq
|
||||
|
||||
@@ -16,6 +17,73 @@ describe('color scheme compatibility', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('manual syntax highlight', 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()
|
||||
--ignore highligting of ~-lines
|
||||
screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
|
||||
--syntax highlight for vimcscripts "echo"
|
||||
screen:set_default_attr_ids( {[1] = {bold=true, foreground=Screen.colors.Brown}} )
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
screen:detach()
|
||||
os.remove('Xtest-functional-ui-highlight.tmp.vim')
|
||||
end)
|
||||
|
||||
-- test with "set hidden" even if the bug did not occur this way
|
||||
it("works with buffer switch and 'hidden'", function()
|
||||
execute('e tmp1.vim')
|
||||
execute('e Xtest-functional-ui-highlight.tmp.vim')
|
||||
execute('filetype on')
|
||||
execute('syntax manual')
|
||||
execute('set ft=vim')
|
||||
execute('set syntax=ON')
|
||||
feed('iecho 1<esc>0')
|
||||
|
||||
execute('set hidden')
|
||||
execute('w')
|
||||
execute('bn')
|
||||
execute('bp')
|
||||
screen:expect([[
|
||||
{1:^echo} 1 |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
<f 1 --100%-- col 1 |
|
||||
]])
|
||||
end)
|
||||
|
||||
it("works with buffer switch and 'nohidden'", function()
|
||||
execute('e tmp1.vim')
|
||||
execute('e Xtest-functional-ui-highlight.tmp.vim')
|
||||
execute('filetype on')
|
||||
execute('syntax manual')
|
||||
execute('set ft=vim')
|
||||
execute('set syntax=ON')
|
||||
feed('iecho 1<esc>0')
|
||||
|
||||
execute('set nohidden')
|
||||
execute('w')
|
||||
execute('bn')
|
||||
execute('bp')
|
||||
screen:expect([[
|
||||
{1:^echo} 1 |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
<ht.tmp.vim" 1L, 7C |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
describe('Default highlight groups', function()
|
||||
-- Test the default attributes for highlight groups shown by the :highlight
|
||||
@@ -38,6 +106,7 @@ describe('Default highlight groups', function()
|
||||
after_each(function()
|
||||
screen:detach()
|
||||
end)
|
||||
|
||||
it('window status bar', function()
|
||||
screen:set_default_attr_ids({
|
||||
[1] = {reverse = true, bold = true}, -- StatusLine
|
||||
|
||||
Reference in New Issue
Block a user