From 396c60f24c68339405cffa2ac8a42f076a7ea555 Mon Sep 17 00:00:00 2001 From: Joshua Priddle Date: Sat, 20 Feb 2016 21:00:06 -0500 Subject: [PATCH] Avoid multiple `syntax enable` during Vim startup --- plug.vim | 4 +++- test/workflow.vader | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plug.vim b/plug.vim index 1b56637..3131ba1 100644 --- a/plug.vim +++ b/plug.vim @@ -248,7 +248,9 @@ function! plug#end() call s:reorg_rtp() filetype plugin indent on if has('vim_starting') - syntax enable + if has('syntax') && !exists('g:syntax_on') + syntax enable + end else call s:reload() endif diff --git a/test/workflow.vader b/test/workflow.vader index d54dd37..9177ca4 100644 --- a/test/workflow.vader +++ b/test/workflow.vader @@ -941,7 +941,7 @@ Execute (Filetype-based on-demand loading): AssertEqual ['xxx/ftdetect', 'xxx/after/ftdetect'], g: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) setf yyy