mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #6600 from jamessan/post-sourcing-filetype
Test handling of "filetype ... off"/"syntax off" after startup scripts
This commit is contained in:
commit
ce245c2c61
@ -23,7 +23,7 @@ describe('startup defaults', function()
|
||||
if helpers.pending_win32(pending) then return end
|
||||
|
||||
local function expect_filetype(expected)
|
||||
local screen = Screen.new(48, 4)
|
||||
local screen = Screen.new(50, 4)
|
||||
screen:attach()
|
||||
command('filetype')
|
||||
screen:expect([[
|
||||
@ -63,6 +63,24 @@ describe('startup defaults', function()
|
||||
expect_filetype(
|
||||
'filetype detection:ON plugin:OFF indent:ON |')
|
||||
end)
|
||||
|
||||
it('adjusted by late `filetype off`', function()
|
||||
init_session('-u', 'NORC', '-c', 'filetype off')
|
||||
expect_filetype(
|
||||
'filetype detection:OFF plugin:(on) indent:(on) |')
|
||||
end)
|
||||
|
||||
it('adjusted by late `filetype plugin off`', function()
|
||||
init_session('-u', 'NORC', '-c', 'filetype plugin off')
|
||||
expect_filetype(
|
||||
'filetype detection:ON plugin:OFF indent:ON |')
|
||||
end)
|
||||
|
||||
it('adjusted by late `filetype indent off`', function()
|
||||
init_session('-u', 'NORC', '-c', 'filetype indent off')
|
||||
expect_filetype(
|
||||
'filetype detection:ON plugin:ON indent:OFF |')
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('syntax', function()
|
||||
@ -80,6 +98,11 @@ describe('startup defaults', function()
|
||||
init_session('-u', 'NORC', '--cmd', 'syntax off')
|
||||
eq(0, eval('exists("g:syntax_on")'))
|
||||
end)
|
||||
|
||||
it('adjusted by late `syntax off`', function()
|
||||
init_session('-u', 'NORC', '-c', 'syntax off')
|
||||
eq(0, eval('exists("g:syntax_on")'))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('packpath', function()
|
||||
|
Loading…
Reference in New Issue
Block a user