mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:50:04 +08:00
fix(spell): handle error of SPC t S
This commit is contained in:
parent
9c6875396b
commit
a3031c6b92
@ -310,6 +310,7 @@ function! s:toggle_syntax_checker() abort
|
||||
elseif g:spacevim_lint_engine ==# 'ale'
|
||||
ALEToggle
|
||||
endif
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
|
||||
|
@ -701,18 +701,21 @@ endfunction
|
||||
" This func is used to toggle major mode in statusline
|
||||
|
||||
function! SpaceVim#layers#core#statusline#toggle_mode(name) abort
|
||||
if index(s:loaded_modes, a:name) != -1
|
||||
call remove(s:loaded_modes, index(s:loaded_modes, a:name))
|
||||
else
|
||||
call add(s:loaded_modes, a:name)
|
||||
endif
|
||||
let mode = get(s:modes, a:name, {})
|
||||
call SpaceVim#logger#info('try to call func of mode:' . a:name)
|
||||
if has_key(mode, 'func')
|
||||
call call(mode.func, [])
|
||||
let done = call(mode.func, [])
|
||||
else
|
||||
let done = 1
|
||||
call SpaceVim#logger#info('no func found for mode:' . a:name)
|
||||
endif
|
||||
if index(s:loaded_modes, a:name) != -1
|
||||
call remove(s:loaded_modes, index(s:loaded_modes, a:name))
|
||||
else
|
||||
if done
|
||||
call add(s:loaded_modes, a:name)
|
||||
endif
|
||||
endif
|
||||
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||
call s:update_conf()
|
||||
endfunction
|
||||
|
@ -432,13 +432,21 @@ function! s:toggle_spell_check() abort
|
||||
if &l:spell
|
||||
let &l:spell = 0
|
||||
else
|
||||
let &l:spell = 1
|
||||
let v:errmsg = ''
|
||||
silent! let &l:spell = 1
|
||||
endif
|
||||
if &l:spell == 1
|
||||
echo 'spell-checking enabled.'
|
||||
if v:errmsg !=# ''
|
||||
echo 'failed to enable spell check'
|
||||
silent! let &l:spell = 0
|
||||
return 0
|
||||
else
|
||||
echo 'spell-checking disabled.'
|
||||
if &l:spell == 1
|
||||
echo 'spell-checking enabled.'
|
||||
else
|
||||
echo 'spell-checking disabled.'
|
||||
endif
|
||||
endif
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! s:toggle_paste() abort
|
||||
@ -452,6 +460,7 @@ function! s:toggle_paste() abort
|
||||
else
|
||||
echo 'paste-mode disabled.'
|
||||
endif
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
let s:whitespace_enable = 0
|
||||
|
Loading…
Reference in New Issue
Block a user