Hey Guys, I'm using Taglist 4.5 and encountered a problem which cost me a whole day to find it.
When processing a file, a "0xA" byte will be put in the front of the temp generated batch file "taglist.cmd".
This causes the cmd.exe fail to execute it and says that it can't find the file.
I don't know how to control the "redir" command's behavior, does anyone have met the same question ?
The corresponding code is in s:Tlist_Process_File() funciton in Taglist.vim as bellow.
if has('win32') && !has('win32unix') && !has('win95')
\ && (&shell =~ 'cmd.exe')
" Windows does not correctly deal with commands that have more than 1
" set of double quotes. It will strip them all resulting in:
" 'C:\Program' is not recognized as an internal or external command
" operable program or batch file. To work around this, place the
" command inside a batch file and call the batch file.
" Do this only on Win2K, WinXP and above.
" Contributed by: David Fishburn.
let s:taglist_tempfile = fnamemodify(tempname(), ':h') .
exe 'redir! > ' . s:taglist_tempfile
silent echo ctags_cmd
call s:Tlist_Log_Msg('Cmd inside batch file: ' . ctags_cmd)
let ctags_cmd = '"' . s:taglist_tempfile . '"'
call s:Tlist_Log_Msg('Cmd: ' . ctags_cmd)
" Run ctags and get the tag list
let cmd_output = system(ctags_cmd)
call s:Tlist_Log_Msg('Cmd Output: ' . cmd_output)
-- dance like nobody's watching……