mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:30:05 +08:00
WIP: improve Neomake integration
Ref: https://github.com/SpaceVim/SpaceVim/issues/200
This commit is contained in:
parent
919b93f678
commit
799317cc2f
@ -200,12 +200,7 @@ endfunction
|
|||||||
function! s:toggle_syntax_checker() abort
|
function! s:toggle_syntax_checker() abort
|
||||||
call SpaceVim#layers#core#statusline#toggle_section('syntax checking')
|
call SpaceVim#layers#core#statusline#toggle_section('syntax checking')
|
||||||
call SpaceVim#layers#core#statusline#toggle_mode('syntax-checking')
|
call SpaceVim#layers#core#statusline#toggle_mode('syntax-checking')
|
||||||
let g:_spacevim_toggle_syntax_flag = g:_spacevim_toggle_syntax_flag * -1
|
verbose NeomakeToggle
|
||||||
if g:_spacevim_toggle_syntax_flag == 1
|
|
||||||
echo 'syntax-checking enabled.'
|
|
||||||
else
|
|
||||||
echo 'syntax-checking disabled.'
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:toggle_spell_check() abort
|
function! s:toggle_spell_check() abort
|
||||||
|
@ -1,23 +1,12 @@
|
|||||||
|
let s:neomake_automake_events = {}
|
||||||
if get(g:, 'spacevim_lint_on_save', 0)
|
if get(g:, 'spacevim_lint_on_save', 0)
|
||||||
augroup Neomake_on_save
|
let s:neomake_automake_events['BufWritePost'] = {'delay': 0}
|
||||||
au!
|
|
||||||
autocmd! BufWritePost * call s:neomake()
|
|
||||||
augroup END
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:_spacevim_toggle_syntax_flag = 1
|
|
||||||
|
|
||||||
function! s:neomake() abort
|
|
||||||
if g:_spacevim_toggle_syntax_flag == 1
|
|
||||||
Neomake
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if get(g:, 'spacevim_lint_on_the_fly', 0)
|
if get(g:, 'spacevim_lint_on_the_fly', 0)
|
||||||
let g:neomake_tempfile_enabled = 1
|
let s:neomake_automake_events['TextChanged'] = {'delay': 750}
|
||||||
let g:neomake_open_list = 0
|
endif
|
||||||
augroup Neomake_on_the_fly
|
|
||||||
au!
|
if !empty(s:neomake_automake_events)
|
||||||
autocmd! TextChangedI * call s:neomake()
|
call neomake#configure#automake(s:neomake_automake_events)
|
||||||
augroup END
|
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user