Friday, July 16, 2010

Re: Problems with taglist plugin

Uuups I made a mistake in my previous email.
To solve the problem properly you dont need to change the
Tlist_Skip_File(), actually you need to change two functions:
function! s:Tlist_Detect_Filetype(fname)
" Ignore the filetype autocommands
let old_eventignore = &eventignore
set eventignore=FileType

" Save the 'filetype', as this will be changed temporarily
let old_filetype = &filetype

" Run the filetypedetect group of autocommands to determine
" the filetype
exe 'doautocmd filetypedetect BufRead ' . a:fname

" Save the detected filetype
let ftype = &filetype
" Check if the filetype is using a compound name, split it and get the first
" name as the main filetype.
" Split filetype into words
let filetypes= split(ftype, '\W\+')
let ftype = filetypes[0]

" Restore the previous state
let &filetype = old_filetype
let &eventignore = old_eventignore

echom "Filetype detected: " . ftype

return ftype
endfunction


And:

function! s:Tlist_Get_Buffer_Filetype(bnum)
let buf_ft = getbufvar(a:bnum, '&filetype')
" Check if the filetype is using a compound name, split it and get the first
" name as the main filetype.
" Split filetype into words
let filetypes= split(buf_ft, '\W\+')
let buf_ft = filetypes[0]

if bufloaded(a:bnum)
" For loaded buffers, the 'filetype' is already determined
return buf_ft
endif

" For unloaded buffers, if the 'filetype' option is set, return it
if buf_ft != ''
return buf_ft
endif

" Skip non-existent buffers
if !bufexists(a:bnum)
return ''
endif

" For buffers whose filetype is not yet determined, try to determine
" the filetype
let bname = bufname(a:bnum)

return s:Tlist_Detect_Filetype(bname)
endfunction


These two changes will ensure TagList always pick up a single filetype name.
So far seems to be working just fine.

El día 15 de julio de 2010 16:49, Yegappan Lakshmanan
<yegappanl@gmail.com> escribió:
> Hi,
>
> 2010/7/15 Pablo Giménez <pablogipi@gmail.com>:
>> Thanks Yegappan.
>> I have attached the output.
>> I have a couple of logs, the old one, tlistDebug.log is when the
>> plugin was working.
>> The new onw, tlist.log is with taglist not working.
>> Looking at it seems that taglist is not detecting I have a new buffer
>> opened with a file and then is not refreshing the tags.
>>
>
> From the logs, I see that you are using the minibufexplorer plugin.
> Both the plugins use the BufEnter autocmd. One plugin may interfere
> with the other plugin. To isolate this problem, can you try using
> only the taglist plugin?
>
> - Yegappan
>
>> Thanks
>>
>> 2010/7/15 Yegappan Lakshmanan <yegappanl@gmail.com>:
>>> Hi,
>>>
>>> 2010/7/13 Pablo Giménez <pablogipi@gmail.com>:
>>>> Yep.
>>>> I have checked system() is working in the new build, and this is the
>>>> output of  the shell options described in the faq:
>>>> shell=/bin/tcsh
>>>> shellcmdflag=-c
>>>> shellpipe=|& tee
>>>> shellquote=
>>>> shellredir=>&
>>>> shellxquote=
>>>>
>>>> I cant see nothing wrong.
>>>> I don't know if there is any difference between the old system vimrc
>>>> and the new because vim hsa been installed by the sysadmin.
>>>>
>>>
>>> Can you perform the following steps and send me the log file?
>>>
>>> $ vim
>>> :TlistDebug tlist.log
>>> <Open a program file>
>>> :Tlist
>>> :qall
>>>
>>> Send me the messages logged in the tlist.log file.
>>>
>>> - Yegappan
>>>
>>>>
>>>> 2010/7/13 Yegappan Lakshmanan <yegappanl@gmail.com>:
>>>>> Hi Pablo,
>>>>>
>>>>> 2010/7/13 Pablo Giménez <pablogipi@gmail.com>:
>>>>>> Hi
>>>>>> I have been using vim 7.1 and now changed to vim7.2.
>>>>>> Not sure if my problems with the taglist plugin begun with that
>>>>>> change, but is the only thing I have change recently I think.
>>>>>> The problem is that when I open the taglist window the buffer is empty
>>>>>> it only shows the help message, but no tags appears at all.
>>>>>> Also the Tags menu appears empty only with the Refresh Menu and Sort
>>>>>> menu ... but no tags from my files.
>>>>>> I can use tags using the default tags option in the gvim toolber which
>>>>>> basically runs !ctags -R .
>>>>>> But will be really handy to have taglist working again.
>>>>>>
>>>>>> Has somebody suffer the same problem with taglist plugin before?
>>>>>> Thanks
>>>>>>
>>>>>
>>>>> Did you try the steps described in the taglist FAQ page?
>>>>>
>>>>> http://vim-taglist.sourceforge.net/faq.html
>>>>>
>>>>> Did you compare the system vimrc file before and after the upgrade?
>>>>>
>>>>> - Yegappan
>>>>>
>>>
>>
>>
>>
>> --
>> Un saludo
>> Best Regards
>> Pablo Giménez
>>
>

--
Un saludo
Best Regards
Pablo Giménez

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: