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:
parent
78e2b24d4b
commit
1eeff6661f
@ -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))
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user