mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-13 02:05:40 +08:00
Add key binding SPC e e (#2507)
This commit is contained in:
parent
cb2a319e80
commit
dcecba8ea0
@ -91,6 +91,9 @@ function! SpaceVim#layers#checkers#config() abort
|
|||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 's'], 'call call('
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 's'], 'call call('
|
||||||
\ . string(s:_function('s:toggle_syntax_checker')) . ', [])',
|
\ . string(s:_function('s:toggle_syntax_checker')) . ', [])',
|
||||||
\ 'toggle syntax checker', 1)
|
\ 'toggle syntax checker', 1)
|
||||||
|
call SpaceVim#mapping#space#def('nnoremap', ['e', 'e'], 'call call('
|
||||||
|
\ . string(s:_function('s:explain_the_error')) . ', [])',
|
||||||
|
\ 'explain the error', 1)
|
||||||
augroup SpaceVim_layer_checker
|
augroup SpaceVim_layer_checker
|
||||||
autocmd!
|
autocmd!
|
||||||
if g:spacevim_enable_neomake
|
if g:spacevim_enable_neomake
|
||||||
@ -221,6 +224,28 @@ function! s:toggle_syntax_checker() abort
|
|||||||
verbose NeomakeToggle
|
verbose NeomakeToggle
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:explain_the_error() abort
|
||||||
|
if g:spacevim_enable_neomake
|
||||||
|
try
|
||||||
|
let message = neomake#GetCurrentErrorMsg()
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E117/
|
||||||
|
let message = ''
|
||||||
|
endtry
|
||||||
|
elseif g:spacevim_enable_ale
|
||||||
|
try
|
||||||
|
let message = neomake#GetCurrentErrorMsg()
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E117/
|
||||||
|
let message = ''
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
if !empty(message)
|
||||||
|
echo message
|
||||||
|
else
|
||||||
|
echo 'no error message at this point!'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:error_transient_state() abort
|
function! s:error_transient_state() abort
|
||||||
if g:spacevim_enable_neomake
|
if g:spacevim_enable_neomake
|
||||||
let num_errors = neomake#statusline#LoclistCounts()
|
let num_errors = neomake#statusline#LoclistCounts()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user