comparison autoload/gutentags/ctags.vim @ 273:8ddbcbfa57b2

Re-create wildignore options file if missing When the wildignore options file is a temp file it can be deleted by other processes which clean up temp files, so check the file is readable and re-create if necessary before adding it to the list of files from which to read exclusion patterns (-x option for update_tags scripts). Without this Gutentags sometimes gets stuck in a rut reporting ctags job failed, probably because I use both GUI vim and terminal vim, but might not use the GUI for days and when I return to it the temp file is gone.
author Mark Woods <mwoods.online.ie@gmail.com>
date Wed, 03 Aug 2022 18:22:56 +0100
parents 6030953258fe
children efe305d995a0
comparison
equal deleted inserted replaced
272:b094a03a8115 273:8ddbcbfa57b2
245 return expand(exepath, 1) 245 return expand(exepath, 1)
246 endfunction 246 endfunction
247 247
248 function! s:generate_wildignore_options() abort 248 function! s:generate_wildignore_options() abort
249 if s:last_wildignores == &wildignore 249 if s:last_wildignores == &wildignore
250 " The 'wildignore' setting didn't change since last time we did this. 250 " The 'wildignore' setting didn't change since last time we did this,
251 call gutentags#trace("Wildignore options file is up to date.") 251 " but check if file still exist (could have been deleted if temp file)
252 return 252 if filereadable(s:wildignores_options_path)
253 call gutentags#trace("Wildignore options file is up to date.")
254 return
255 else
256 call gutentags#trace("Wildignore options file is not readable.")
257 endif
253 endif 258 endif
254 259
255 if s:wildignores_options_path == '' 260 if s:wildignores_options_path == ''
256 if empty(g:gutentags_cache_dir) 261 if empty(g:gutentags_cache_dir)
257 let s:wildignores_options_path = tempname() 262 let s:wildignores_options_path = tempname()