Skip to content

Commit

Permalink
Try using my own tempname
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Jul 13, 2019
1 parent 14ee626 commit 310ca5b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions autoload/vista/executive/ctags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,23 @@ endfunction
" slow down Tagbar for files that sit on slow network drives.
" This idea comes from tagbar.
function! s:IntoTemp(...) abort
let tmp = tempname()
let ext = t:vista.source.extension()
if !empty(ext)
let tmp = join([tmp, ext], '.')
" Don't use tempname() if possible since it would cause the changing of the anonymous tag name.
"
" Ref: https://github.com/liuchengxu/vista.vim/issues/122#issuecomment-511115932
if exists('$TMPDIR')
if empty($TMPDIR)
let $TMPDIR = '/tmp'
endif
let tmp = sha256(fnamemodify(bufname(t:vista.source.bufnr), ":p"))
if !empty(ext)
let tmp = $TMPDIR.join([tmp, ext], '.')
endif
else
let tmp = tempname()
if !empty(ext)
let tmp = join([tmp, ext], '.')
endif
endif

if empty(a:1)
Expand Down

0 comments on commit 310ca5b

Please sign in to comment.