diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index d90218ce6..e4bc4c5df 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -643,6 +643,9 @@ function! SpaceVim#layers#ui#get_options() abort endfunction function! s:fonts_transient_state() abort + if !exists('s:guifont') + let s:guifont = &guifont + endif let state = SpaceVim#api#import('transient_state') call state.set_title('Fonts Transient State') call state.defind_keys( @@ -656,6 +659,13 @@ function! s:fonts_transient_state() abort \ 'exit' : 0, \ 'cmd' : 'call call(' . string(s:_function('s:increase_font')) . ', [])', \ }, + \ { + \ 'key' : '0', + \ 'desc' : 'reset the font size', + \ 'func' : '', + \ 'exit' : 0, + \ 'cmd' : 'call call(' . string(s:_function('s:reset_font_size')) . ', [])', + \ }, \ ], \ 'right' : [ \ { @@ -671,6 +681,11 @@ function! s:fonts_transient_state() abort call state.open() endfunction +function! s:reset_font_size() abort + let &guifont = s:guifont + sleep 100m +endfunction + function! s:increase_font() abort let font_size = str2nr(matchstr(matchstr(&guifont, ':h\d\+'), '\d\+')) let font_size += 1