On 07-Feb-09 7:38, Tony Mechelynck wrote:
> On 07/02/09 07:27, Dewr wrote:
>> it keeps its filetype even if you didn't give ":setlocal bufhidden=hide".
>> anyway! Vim keeps syntax-highlighting when I've used ":setlocal
>> bufhidden=hide" before I use "bnext"|"bprevious".
>>
>
> Then I think it's working as it should (though it may surprise you). If
> you "hide" the buffer, it keeps everything. If you "unload" it, some of
> the information (including, maybe, the buffer-local 'syntax' set by
> hand) gets lost.
I still think it's a bug, because the behavior is inconsistent (buffer-local
settings like 'filetype' and 'syntax' are kept when the buffer is unloaded, but
the syntax highlighting isn't) and unexpected (when I manually make a setting,
*all* its effects should be kept after :bnext|bprev).
I couldn't find an explanation or description of how it should work in the
help,
so maybe Bram has to chime in with his opinion?!
Anyway, I found another workaround (that could be placed in .vimrc if you're
annoyed by the current behavior), which I hope has fewer side effects than
':set
hidden':
autocmd! BufRead * if exists('syntax_on') || exists('syntax_manual') | syntax
enable | endif
-- regards, ingo
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---