Am 26.10.2011 22:47, schrieb Thilo Six:
Peng Yu wrote the following on 25.10.2011 22:25

Hello

-- <snip>  --

I'm glad it works, but something is wrong here.

-- <snip>  --

It seems tabbar.vim is involved, though i haven't currently figured how. Peng do
you also have tabbar.vim installed?

No. I have the following packages installed. Does anybody know which
one might cause the problem?

-- <snip>  --

hmm it seems we do not have any plugins in commen. Though i can reproducible get
the error if i have 'set nohidden' and tabbar.vim, then open one file
'vim foo' and an other ':e bar' then ':bd'.
I have noticed not all buffers get syntax turned off, but instead if you have
three, or four files open it is reproducible the last but one that get turned
off and that even with ':echo syntax_on' = 1 in that buffer. And if you have
some other files open and switch between them syntax highlighting is turned on
again in the buffer when switching back.

Tabbar.vim has a comment saying:

,----[  tabbar.vim  ]--------

             " VIM sometimes turns syntax highlighting off,
             " we can force it on, but this may cause weird
             " behavior so this is an optional hack to force
             " syntax back on when we enter a buffer
             if g:Tb_ForceSyntaxEnable
                 if g:Tb_DBG_LVL>  0
                     call<SID>DEBUG('Tb_AutoUpdt: Enable Syntax', 9)
                 endif
                 exec 'syntax enable'
             endif

`---------------------------------------------
This is with vim 7.2.445.
Can someone test with a up to date vim to see if it happens there, too?

I've checked tabbar.vim, v0.7, vimscript #1338.

Reason for missing syntax highlighting (no bug in Vim): autocommands are
not called recursively per default
    :h autocmd-nested

tabbar executes  :bn!  within a BufEnter autocmd (BufEnter without
"nested" argument).  Thus  :bn!  can't trigger further autocommands.

But with 'nohidden', buffers are unloaded when they are not shown in a
window.  :bn!  needs to execute BufRead autocommands for syntax/ftplugin
stuff (just like with :edit) when it creates the first window for a
buffer.

--
Andy

--
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

Reply via email to