From 1014b85f50d9bf795332c7ab377389df5d89c370 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 1 Jul 2023 21:55:58 +0800 Subject: [PATCH] perf(guide): add guide offset, len = 8 --- autoload/SpaceVim/mapping/guide.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/mapping/guide.vim b/autoload/SpaceVim/mapping/guide.vim index 397e029d3..35a04e479 100644 --- a/autoload/SpaceVim/mapping/guide.vim +++ b/autoload/SpaceVim/mapping/guide.vim @@ -316,11 +316,12 @@ function! s:create_string(layout) abort " {{{ let col = 0 let smap = sort(filter(keys(s:lmap), 'v:val !=# "name"'), function('s:compare_key')) for k in smap + let offset = repeat(' ', 8 - strlen(k)) let desc = type(s:lmap[k]) == type({}) ? s:lmap[k].name : s:lmap[k][1] if g:spacevim_leader_guide_theme == 'whichkey' - let displaystring = k .' -> '.desc + let displaystring = offset . k .' -> '.desc else - let displaystring = '['. k .'] '.desc + let displaystring = offset . '['. k .'] '.desc endif let crow = get(rows, row, []) if empty(crow)