1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Ease debuggin

When debug is enabled
- add verbose flag to ctags
- don't remove temp files
- log the temporary file created
This commit is contained in:
Matthieu Coudron
2017-09-21 22:17:41 +09:00
parent ad0e433674
commit 72416b1c62

View File

@@ -985,12 +985,21 @@ function! s:ProcessFile(fname, ftype) abort
let tempfile .= '.' . ext
endif
call writefile(getbufline(fileinfo.bufnr, 1, '$'), tempfile)
call tagbar#debug#log('Caching file into: ' . tempfile)
let templines = getbufline(fileinfo.bufnr, 1, '$')
let res = writefile(templines, tempfile)
if res != 0
call tagbar#debug#log('Could not create copy '.tempfile)
return
endif
let fileinfo.mtime = getftime(tempfile)
let ctags_output = s:ExecuteCtagsOnFile(tempfile, a:fname, typeinfo)
call delete(tempfile)
if !tagbar#debug#enabled()
call delete(tempfile)
endif
if ctags_output == -1
call tagbar#debug#log('Ctags error when processing file')
@@ -1088,6 +1097,11 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
\ '--append=no'
\ ]
" verbose if debug enabled
if tagbar#debug#enabled()
let ctags_args += [ '-V' ]
endif
" Include extra type definitions
if has_key(a:typeinfo, 'deffile')
let ctags_args += ['--options=' . expand(a:typeinfo.deffile)]