diff --git a/autoload/SpaceVim/mapping/guide.vim b/autoload/SpaceVim/mapping/guide.vim index 39c055e85..80875b030 100644 --- a/autoload/SpaceVim/mapping/guide.vim +++ b/autoload/SpaceVim/mapping/guide.vim @@ -512,10 +512,15 @@ if !exists("g:leaderGuide_displayfunc") let g:leaderGuide_displayfunc = [function("s:leaderGuide_display")] endif -call SpaceVim#mapping#guide#register_prefix_descriptions('\', - \ 'g:_spacevim_mappings') -call SpaceVim#mapping#guide#register_prefix_descriptions(' ', - \ 'g:_spacevim_mappings_space') +if get(g:, 'mapleader', '\') == ' ' + call SpaceVim#mapping#guide#register_prefix_descriptions(' ', + \ 'g:_spacevim_mappings') +else + call SpaceVim#mapping#guide#register_prefix_descriptions('\', + \ 'g:_spacevim_mappings') + call SpaceVim#mapping#guide#register_prefix_descriptions(' ', + \ 'g:_spacevim_mappings_space') +endif call SpaceVim#mapping#guide#register_prefix_descriptions( \ g:spacevim_unite_leader, \ 'g:_spacevim_mappings_unite') diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index 4e6a92b58..f14718273 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -52,8 +52,5 @@ function! SpaceVim#mapping#space#def(m, keys, cmd, desc, is_cmd) abort endfunction function! s:has_map_to_spc() abort - if !exists('s:flag') - let s:flag = !empty(maparg('', '',0,1)) - endif - return s:flag + return get(g:, 'mapleader', '\') == ' ' endfunction