mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 01:10:05 +08:00
fix(history): fix history pos
This commit is contained in:
parent
c28fda48b1
commit
bee24ee792
@ -13,14 +13,22 @@ let s:history_cache_path = s:FILE.unify_path(g:spacevim_data_dir, ':p') . 'Space
|
|||||||
let s:filepos = {}
|
let s:filepos = {}
|
||||||
|
|
||||||
function! SpaceVim#plugins#history#readcache() abort
|
function! SpaceVim#plugins#history#readcache() abort
|
||||||
|
call s:LOG.debug('read cache')
|
||||||
call s:read_cache()
|
call s:read_cache()
|
||||||
endfunction
|
endfunction
|
||||||
function! SpaceVim#plugins#history#writecache() abort
|
function! SpaceVim#plugins#history#writecache() abort
|
||||||
|
call s:LOG.debug('write cache')
|
||||||
call s:write_cache()
|
call s:write_cache()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#plugins#history#jumppos() abort
|
function! SpaceVim#plugins#history#jumppos() abort
|
||||||
|
" nvim filename
|
||||||
|
" BufReadPost event before VimEnter
|
||||||
|
if empty(s:filepos)
|
||||||
|
call s:read_cache()
|
||||||
|
endif
|
||||||
let [l, c] = get(s:filepos, expand('%:p'), [0, 0])
|
let [l, c] = get(s:filepos, expand('%:p'), [0, 0])
|
||||||
|
call s:LOG.debug(printf('jump to pos: [%s, %s]', l, c))
|
||||||
if l != 0 && c != 0
|
if l != 0 && c != 0
|
||||||
call cursor(l, c)
|
call cursor(l, c)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user