1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:10:06 +08:00

perf(history): skip empty file and save pos before opening startify

This commit is contained in:
Eric Wong 2024-03-18 22:22:16 +08:00
parent 78e2b24d4b
commit 1eeff6661f
2 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,9 @@ function! SpaceVim#plugins#history#jumppos() abort
endfunction
function! SpaceVim#plugins#history#savepos() abort
if empty(bufname()) || &buftype == 'nofile'
return
endif
call s:LOG.debug('save pos for:' . bufname())
let [_, l, c, _] = getpos('.')
call s:LOG.debug(printf('line %d, col %d', l, c))

View File

@ -60,7 +60,7 @@ augroup END
if !exists('g:startify_custom_header')
call s:update_logo()
endif
call SpaceVim#mapping#space#def('nnoremap', ['a','s'], 'Startify | doautocmd WinEnter', 'fancy start screen',1)
call SpaceVim#mapping#space#def('nnoremap', ['a','s'], 'call SpaceVim#plugins#history#savepos() | Startify | doautocmd WinEnter', 'fancy start screen',1)
if g:spacevim_enable_tabline_ft_icon || get(g:, 'spacevim_enable_tabline_filetype_icon', 0)
" the old option g:spacevim_enable_tabline_filetype_icon should also works