mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:40:03 +08:00
Fix checkers layer
Fix an issue layer option show_cursor_error won't work. Show error message in command line if show_cursor_error is off. Show warning message if show_cursor_error were set to on without timer feature.
This commit is contained in:
parent
bb980c32ec
commit
f6bb955989
@ -20,16 +20,29 @@ function! SpaceVim#layers#checkers#plugins() abort
|
||||
return plugins
|
||||
endfunction
|
||||
|
||||
let s:show_cursor_error = 1
|
||||
|
||||
function! SpaceVim#layers#checkers#set_variable(var) abort
|
||||
|
||||
let s:show_cursor_error = get(a:var, 'show_cursor_error', 1)
|
||||
|
||||
if s:show_cursor_error && !has('timer')
|
||||
call SpaceVim#logger#warn('show_cursor_error in checkers layer needs timer feature')
|
||||
let s:show_cursor_error = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! SpaceVim#layers#checkers#config() abort
|
||||
"" neomake/neomake {{{
|
||||
" This setting will echo the error for the line your cursor is on, if any.
|
||||
let g:neomake_echo_current_error = get(g:, 'neomake_echo_current_error', !s:show_cursor_error)
|
||||
let g:neomake_cursormoved_delay = get(g:, 'neomake_cursormoved_delay', 300)
|
||||
"" }}}
|
||||
|
||||
"" w0rp/ale {{{
|
||||
let g:ale_echo_delay = get(g:, 'ale_echo_delay', 300)
|
||||
"" }}}
|
||||
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['e', 'c'], 'call call('
|
||||
\ . string(s:_function('s:clear_errors')) . ', [])',
|
||||
@ -55,7 +68,7 @@ function! SpaceVim#layers#checkers#config() abort
|
||||
if g:spacevim_enable_neomake
|
||||
autocmd User NeomakeFinished nested
|
||||
\ let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||
if has('timers')
|
||||
if s:show_cursor_error
|
||||
" when move cursor, the error message will be shown below current line
|
||||
" after a delay
|
||||
autocmd CursorMoved * call <SID>neomake_cursor_move_delay()
|
||||
|
@ -4,8 +4,6 @@ if get(g:, 'spacevim_lint_on_save', 0)
|
||||
let s:neomake_automake_events['BufWritePost'] = {'delay': 0}
|
||||
endif
|
||||
|
||||
let g:neomake_echo_current_error = 0
|
||||
|
||||
if get(g:, 'spacevim_lint_on_the_fly', 0)
|
||||
let s:neomake_automake_events['TextChanged'] = {'delay': 750}
|
||||
let s:neomake_automake_events['TextChangedI'] = {'delay': 750}
|
||||
|
Loading…
Reference in New Issue
Block a user