mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:40:03 +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
|
||||
call SpaceVim#layers#core#statusline#toggle_section('syntax checking')
|
||||
call SpaceVim#layers#core#statusline#toggle_mode('syntax-checking')
|
||||
let g:_spacevim_toggle_syntax_flag = g:_spacevim_toggle_syntax_flag * -1
|
||||
if g:_spacevim_toggle_syntax_flag == 1
|
||||
echo 'syntax-checking enabled.'
|
||||
else
|
||||
echo 'syntax-checking disabled.'
|
||||
endif
|
||||
verbose NeomakeToggle
|
||||
endfunction
|
||||
|
||||
function! s:toggle_spell_check() abort
|
||||
|
@ -1,23 +1,12 @@
|
||||
let s:neomake_automake_events = {}
|
||||
if get(g:, 'spacevim_lint_on_save', 0)
|
||||
augroup Neomake_on_save
|
||||
au!
|
||||
autocmd! BufWritePost * call s:neomake()
|
||||
augroup END
|
||||
let s:neomake_automake_events['BufWritePost'] = {'delay': 0}
|
||||
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)
|
||||
let g:neomake_tempfile_enabled = 1
|
||||
let g:neomake_open_list = 0
|
||||
augroup Neomake_on_the_fly
|
||||
au!
|
||||
autocmd! TextChangedI * call s:neomake()
|
||||
augroup END
|
||||
let s:neomake_automake_events['TextChanged'] = {'delay': 750}
|
||||
endif
|
||||
|
||||
if !empty(s:neomake_automake_events)
|
||||
call neomake#configure#automake(s:neomake_automake_events)
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user