diff --git a/autoload/gutentags.vim b/autoload/gutentags.vim index 563eb5d..c53f28c 100644 --- a/autoload/gutentags.vim +++ b/autoload/gutentags.vim @@ -311,7 +311,8 @@ endfor " Make a given file known as being currently generated or updated. function! gutentags#add_progress(module, file) abort - let s:maybe_in_progress[a:module][a:file] = localtime() + let l:abs_file = fnamemodify(a:file, ':p') + let s:maybe_in_progress[a:module][l:abs_file] = localtime() endfunction " Get how to execute an external command depending on debug settings. @@ -463,8 +464,10 @@ endfunction function! gutentags#inprogress() echom "gutentags: generations in progress:" - for mip in keys(s:maybe_in_progress) - echom mip + for mod_name in keys(s:maybe_in_progress) + for mib in keys(s:maybe_in_progress[mod_name]) + echom mod_name.": ".mib + endfor endfor echom "" endfunction @@ -505,7 +508,7 @@ function! gutentags#statusline(...) abort let l:progress_queue = s:maybe_in_progress[module] let l:timestamp = get(l:progress_queue, l:abs_tag_file) if l:timestamp == 0 - return '' + continue endif " It's maybe generating! Check if the lock file is still there... but " don't do it too soon after the script was originally launched, because @@ -514,19 +517,21 @@ function! gutentags#statusline(...) abort if (localtime() - l:timestamp) > 1 && \!filereadable(l:abs_tag_file . '.lock') call remove(l:progress_queue, l:abs_tag_file) - return '' + continue endif call add(l:modules_in_progress, module) endfor + if len(l:modules_in_progress) == 0 + return '' + endif + " It's still there! So probably `ctags` is still running... " (although there's a chance it crashed, or the script had a problem, and " the lock file has been left behind... we could try and run some " additional checks here to see if it's legitimately running, and " otherwise delete the lock file... maybe in the future...) - if len(g:gutentags_modules) > 1 - let l:gen_msg .= '['.join(l:modules_in_progress, ',').']' - endif + let l:gen_msg .= '['.join(l:modules_in_progress, ',').']' return l:gen_msg endfunction diff --git a/autoload/gutentags/cscope.vim b/autoload/gutentags/cscope.vim index e93a05e..6ae264e 100644 --- a/autoload/gutentags/cscope.vim +++ b/autoload/gutentags/cscope.vim @@ -93,8 +93,7 @@ function! gutentags#cscope#generate(proj_dir, tags_file, write_mode) abort let job_id = jobstart(job_cmd, job_dict) endif - let l:full_scopedb_file = fnamemodify(a:tags_file, ':p') - call gutentags#add_progress('cscope', l:full_scopedb_file) + call gutentags#add_progress('cscope', a:tags_file) else call gutentags#trace("(fake... not actually running)") endif diff --git a/autoload/gutentags/ctags.vim b/autoload/gutentags/ctags.vim index 82f36aa..2a25eb7 100644 --- a/autoload/gutentags/ctags.vim +++ b/autoload/gutentags/ctags.vim @@ -179,8 +179,7 @@ function! gutentags#ctags#generate(proj_dir, tags_file, write_mode) abort endif " Flag this tags file as being in progress - let l:full_tags_file = fnamemodify(a:tags_file, ':p') - call gutentags#add_progress('ctags', l:full_tags_file) + call gutentags#add_progress('ctags', a:tags_file) else call gutentags#trace("(fake... not actually running)") endif diff --git a/autoload/gutentags/gtags_cscope.vim b/autoload/gutentags/gtags_cscope.vim index 7889ce1..ca02f36 100644 --- a/autoload/gutentags/gtags_cscope.vim +++ b/autoload/gutentags/gtags_cscope.vim @@ -177,8 +177,7 @@ function! gutentags#gtags_cscope#generate(proj_dir, db_file, write_mode) abort endif endif - let l:full_gtags_file = fnamemodify(l:db_path, ':p') - call gutentags#add_progress('gtags_cscope', a:db_file) + call gutentags#add_progress('gtags_cscope', l:db_path) else call gutentags#trace("(fake... not actually running)") endif