Merge pull request #419 from itspriddle/bugfix/syntax-with-cli-command

Avoid multiple `syntax enable` during Vim startup
This commit is contained in:
Junegunn Choi 2016-02-21 11:32:55 +09:00
commit a88753ef4e
2 changed files with 4 additions and 2 deletions

View File

@ -248,7 +248,9 @@ function! plug#end()
call s:reorg_rtp() call s:reorg_rtp()
filetype plugin indent on filetype plugin indent on
if has('vim_starting') if has('vim_starting')
syntax enable if has('syntax') && !exists('g:syntax_on')
syntax enable
end
else else
call s:reload() call s:reload()
endif endif

View File

@ -941,7 +941,7 @@ Execute (Filetype-based on-demand loading):
AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect'], g:xxx AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect'], g:xxx
setf xxx setf xxx
AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect', 'xxx/plugin', 'xxx/after/plugin', 'xxx/syntax', 'xxx/after/syntax', 'xxx/ftplugin', 'xxx/after/ftplugin', 'xxx/indent', 'xxx/after/indent', 'xxx/syntax', 'xxx/after/syntax'], g:xxx AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect', 'xxx/plugin', 'xxx/after/plugin', 'xxx/syntax', 'xxx/after/syntax', 'xxx/ftplugin', 'xxx/after/ftplugin', 'xxx/indent', 'xxx/after/indent'], g:xxx
" syntax/xxx.vim and after/syntax/xxx.vim should not be loaded (#410) " syntax/xxx.vim and after/syntax/xxx.vim should not be loaded (#410)
setf yyy setf yyy