Skip to content

Commit

Permalink
Speedup, only run helptags core/doc when necessary (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-descartes2021 authored May 13, 2022
1 parent 07c136e commit 36f61f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tags
autoload/plug.vim
core/autoload/info.vim
core/autoload/spacevim/info.vim
core/doc/.spacevim_last_helptags_run
plugged/*
*.un~
private/*
Expand Down
17 changes: 12 additions & 5 deletions core/autoload/spacevim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,18 @@ function! spacevim#end() abort
call s:config()
if exists('*UserConfig') | call UserConfig() | endif

try
execute 'helptags' g:spacevim.base . '/core/doc'
catch
echom v:exception
endtry
let helptag_file = g:spacevim.base . '/core/doc/spacevim.txt'
let helptag_time = getftime(helptag_file)
let helptag_lastrun_file = g:spacevim.base . '/core/doc/.spacevim_last_helptags_run'
let helptag_lastrun_time = filereadable(helptag_lastrun_file) ? readfile(helptag_lastrun_file) : []
if (len(helptag_lastrun_time) != 1) || (helptag_lastrun_time[0] != helptag_time)
try
execute 'helptags' g:spacevim.base . '/core/doc'
call writefile([helptag_time], helptag_lastrun_file)
catch
echom v:exception
endtry
endif

call s:check_missing_plugins()
silent doautocmd <nomodeline> User SpacevimAfterUserConfig
Expand Down

0 comments on commit 36f61f8

Please sign in to comment.