From aa5829c0c0e9a49419dc348f819b0a004c4e9db8 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 18 Mar 2018 20:57:14 +0800 Subject: [PATCH] Fix #1505 --- autoload/SpaceVim/autocmds.vim | 4 ++-- autoload/SpaceVim/layers/checkers.vim | 20 +++++++++++--------- autoload/SpaceVim/layers/ui.vim | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/autoload/SpaceVim/autocmds.vim b/autoload/SpaceVim/autocmds.vim index 9f622178c..6c5c81e09 100644 --- a/autoload/SpaceVim/autocmds.vim +++ b/autoload/SpaceVim/autocmds.vim @@ -151,12 +151,12 @@ function! SpaceVim#autocmds#VimEnter() abort for argv in g:_spacevim_mappings_space_custom call call('SpaceVim#mapping#space#def', argv) endfor - if get(g:, '_spacevim_statusline_loaded', 0) == 1 + if SpaceVim#layers#isLoaded('core#statusline') set laststatus=2 call SpaceVim#layers#core#statusline#def_colors() setlocal statusline=%!SpaceVim#layers#core#statusline#get(1) endif - if get(g:, '_spacevim_tabline_loaded', 0) == 1 + if SpaceVim#layers#isLoaded('core#tabline') call SpaceVim#layers#core#tabline#def_colors() set showtabline=2 endif diff --git a/autoload/SpaceVim/layers/checkers.vim b/autoload/SpaceVim/layers/checkers.vim index 77914d34d..ab41116e9 100644 --- a/autoload/SpaceVim/layers/checkers.vim +++ b/autoload/SpaceVim/layers/checkers.vim @@ -72,14 +72,16 @@ function! SpaceVim#layers#checkers#config() abort call SpaceVim#mapping#space#def('nnoremap', ['e', '.'], 'call call(' \ . string(s:_function('s:error_transient_state')) . ', [])', \ 'error-transient-state', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 's'], 'call call(' - \ . string(s:_function('s:toggle_syntax_checker')) . ', [])', - \ 'toggle syntax checker', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 's'], 'call call(' + \ . string(s:_function('s:toggle_syntax_checker')) . ', [])', + \ 'toggle syntax checker', 1) augroup SpaceVim_layer_checker autocmd! if g:spacevim_enable_neomake - autocmd User NeomakeFinished nested - \ let &l:statusline = SpaceVim#layers#core#statusline#get(1) + if SpaceVim#layers#isLoaded('core#statusline') + autocmd User NeomakeFinished nested + \ let &l:statusline = SpaceVim#layers#core#statusline#get(1) + endif if s:show_cursor_error " when move cursor, the error message will be shown below current line " after a delay @@ -95,7 +97,7 @@ function! SpaceVim#layers#checkers#config() abort autocmd InsertEnter,WinLeave * call neomake_signatures_clear() endif endif - elseif g:spacevim_enable_ale + elseif g:spacevim_enable_ale && SpaceVim#layers#isLoaded('core#statusline') autocmd User ALELint \ let &l:statusline = SpaceVim#layers#core#statusline#get(1) endif @@ -150,9 +152,9 @@ function! s:verify_syntax_setup() abort 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') - verbose NeomakeToggle + call SpaceVim#layers#core#statusline#toggle_section('syntax checking') + call SpaceVim#layers#core#statusline#toggle_mode('syntax-checking') + verbose NeomakeToggle endfunction function! s:error_transient_state() abort diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 573aa8354..ee44b9742 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -17,7 +17,7 @@ function! SpaceVim#layers#ui#plugins() abort \ ['t9md/vim-choosewin', {'merged' : 0}], \ ['mhinz/vim-startify', {'loadconf' : 1, 'merged' : 0}], \ ] - if get(g:, '_spacevim_statusline_loaded', 0) == 0 + if !SpaceVim#layers#isLoaded('core#statusline') call add(plugins, ['vim-airline/vim-airline', { 'merged' : 0, \ 'loadconf' : 1}]) call add(plugins, ['vim-airline/vim-airline-themes', { 'merged' : 0}])