Browse Source

Only highlight vim-plug buffers if syntax enabled

Previously, syntax highlighting was turned on unconditionally in the
buffers opened by commands such as `:PlugUpdate`. With this commit,
highlighting is not applied if the user has disabled syntax highlighting
by calling `syntax off` after `call plug#end()` in their `vimrc`.
Scott Stevenson 10 năm trước cách đây
mục cha
commit
6f60192d71
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      plug.vim

+ 3 - 1
plug.vim

@@ -645,7 +645,9 @@ function! s:prepare()
   silent! unmap <buffer> X
   setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap cursorline modifiable
   setf vim-plug
-  call s:syntax()
+  if exists('g:syntax_on')
+    call s:syntax()
+  endif
 endfunction
 
 function! s:assign_name()