From bee24ee792836cc856a764b6eb3db626ece3ddaf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 3 May 2024 21:17:51 +0800 Subject: [PATCH] fix(history): fix history pos --- autoload/SpaceVim/plugins/history.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoload/SpaceVim/plugins/history.vim b/autoload/SpaceVim/plugins/history.vim index 88f860f14..7f0b1af90 100644 --- a/autoload/SpaceVim/plugins/history.vim +++ b/autoload/SpaceVim/plugins/history.vim @@ -13,14 +13,22 @@ let s:history_cache_path = s:FILE.unify_path(g:spacevim_data_dir, ':p') . 'Space let s:filepos = {} function! SpaceVim#plugins#history#readcache() abort + call s:LOG.debug('read cache') call s:read_cache() endfunction function! SpaceVim#plugins#history#writecache() abort + call s:LOG.debug('write cache') call s:write_cache() endfunction 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]) + call s:LOG.debug(printf('jump to pos: [%s, %s]', l, c)) if l != 0 && c != 0 call cursor(l, c) endif