mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 23:10: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'
|
elseif g:spacevim_lint_engine ==# 'ale'
|
||||||
ALEToggle
|
ALEToggle
|
||||||
endif
|
endif
|
||||||
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
@ -701,18 +701,21 @@ endfunction
|
|||||||
" This func is used to toggle major mode in statusline
|
" This func is used to toggle major mode in statusline
|
||||||
|
|
||||||
function! SpaceVim#layers#core#statusline#toggle_mode(name) abort
|
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, {})
|
let mode = get(s:modes, a:name, {})
|
||||||
call SpaceVim#logger#info('try to call func of mode:' . a:name)
|
call SpaceVim#logger#info('try to call func of mode:' . a:name)
|
||||||
if has_key(mode, 'func')
|
if has_key(mode, 'func')
|
||||||
call call(mode.func, [])
|
let done = call(mode.func, [])
|
||||||
else
|
else
|
||||||
|
let done = 1
|
||||||
call SpaceVim#logger#info('no func found for mode:' . a:name)
|
call SpaceVim#logger#info('no func found for mode:' . a:name)
|
||||||
endif
|
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)
|
let &l:statusline = SpaceVim#layers#core#statusline#get(1)
|
||||||
call s:update_conf()
|
call s:update_conf()
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -432,13 +432,21 @@ function! s:toggle_spell_check() abort
|
|||||||
if &l:spell
|
if &l:spell
|
||||||
let &l:spell = 0
|
let &l:spell = 0
|
||||||
else
|
else
|
||||||
let &l:spell = 1
|
let v:errmsg = ''
|
||||||
|
silent! let &l:spell = 1
|
||||||
endif
|
endif
|
||||||
|
if v:errmsg !=# ''
|
||||||
|
echo 'failed to enable spell check'
|
||||||
|
silent! let &l:spell = 0
|
||||||
|
return 0
|
||||||
|
else
|
||||||
if &l:spell == 1
|
if &l:spell == 1
|
||||||
echo 'spell-checking enabled.'
|
echo 'spell-checking enabled.'
|
||||||
else
|
else
|
||||||
echo 'spell-checking disabled.'
|
echo 'spell-checking disabled.'
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:toggle_paste() abort
|
function! s:toggle_paste() abort
|
||||||
@ -452,6 +460,7 @@ function! s:toggle_paste() abort
|
|||||||
else
|
else
|
||||||
echo 'paste-mode disabled.'
|
echo 'paste-mode disabled.'
|
||||||
endif
|
endif
|
||||||
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:whitespace_enable = 0
|
let s:whitespace_enable = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user