>> It is indeed an issue in my config, in particular this line:
>>
>> au BufWritePost * nested filetype detect
>>
>> Which I use to re-read the ctags file so that Omni-complete has the
>> latest information after a file is written.
>
> You shouldn't need to do this. If you have something automatically
> updating the tags database, Vim will always be up-to-date. Vim doesn't
> cache tags info. It always reads from the file. If you're seeing
> otherwise, then it may be that the omnicompletion script is caching the
> tag information and I'd consider that a bug.
I've sorted it out... I originally had:
" Create tags file
au FileType cpp call CreateTags()
au BufWritePost * nested filetype detect
Where:
" Create CTags for all files in the current directory
function! CreateTags()
let currdir = expand('%:p:h')
let currtags = currdir.'/tags'
if getftime(expand('%')) > getftime(currtags)
silent execute '!ctags *'
endif
endfunction
Which would create a tags file in the current directory if the tags
file was older than the age of the file being opened (based on the
file type detection). In order to update the tags file when the file
was written, I had to force a file type detection again.
I've now changed it to:
" Create tags file
au FileType cpp call CreateTags()
au BufWritePost * if &ft == 'cpp' | silent execute '!ctags *' | endif
Which works in similar fashion but doesn't cause the undesired fold collapsing.
Chris
--
Chris Sutcliffe
http://emergedesktop.org
--
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php