mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-14 15:19:12 +08:00
Fix lang#c layer commands (#3796)
This commit is contained in:
parent
b71ee0c96f
commit
dc1c6694e2
@ -133,20 +133,30 @@ function! SpaceVim#layers#lang#c#config() abort
|
||||
augroup SpaceVim_lang_c
|
||||
autocmd!
|
||||
if s:enable_clang_syntax
|
||||
if has('nvim')
|
||||
if s:CPT.has('python3') && SpaceVim#util#haspy3lib('clang')
|
||||
auto FileType c,cpp ChromaticaStart
|
||||
else
|
||||
auto FileType c,cpp ClampStart
|
||||
endif
|
||||
elseif has('job')
|
||||
auto FileType c,cpp ClStart
|
||||
else
|
||||
auto FileType c,cpp ClighterEnable
|
||||
endif
|
||||
auto FileType c,cpp call s:highlight()
|
||||
endif
|
||||
augroup END
|
||||
call add(g:spacevim_project_rooter_patterns, '.clang')
|
||||
if has('nvim')
|
||||
if s:CPT.has('python3') && SpaceVim#util#haspy3lib('clang')
|
||||
let s:highlight_cmd = 'ChromaticaStart'
|
||||
else
|
||||
let s:highlight_cmd = 'ClampStart'
|
||||
endif
|
||||
elseif has('job')
|
||||
let s:highlight_cmd = 'ClStart'
|
||||
else
|
||||
let s:highlight_cmd = 'ClighterEnable'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:highlight_cmd = ''
|
||||
|
||||
function! s:highlight() abort
|
||||
try
|
||||
exe s:highlight_cmd
|
||||
catch
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
let s:enable_clang_syntax = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user