On May 12, 4:46 pm, Andy Wokula <[email protected]> wrote:
> Right: When a buffer is no longer displayed in any window, the old
> window-local options are remembered together with other buffer data
> and restored when the buffer is displayed again.
>
> But these "hidden" window-local options are not accessible ... they are
> only used for restoring.
>
> The gory details are here:
> :h local-options
>
> Not sure if this is something for the todo list, i.e.
> If a buffer is not shown in any window, window-local options saved together
> with the buffer (for restoring) should be accessible with getbufvar().
I think that we can agree on that getbufvar() returning the window
local option value for the buffer currently displayed in the active
window, regardless of the buffer identifier passed to getbufvar(), is
wrong. The behaviour you're suggesting would indeed be preferable, but
I'm not sure that there's an important enough use case for it.
I do have one use case, though: I quite often use two windows to diff
different pairs of files. If I switch to another pair of files,
without turning off 'diff', Vim will eventually become quite confused
as to which files I actually want to diff. In this case, I'd like to
reset the 'diff' option for all buffers, regardless of for which window
(s) this option is remembered. The best method I've found to do this
is ':only | bufdo setl nodiff noscb fdm=syntax | vsplit', and I think
it would be nice to be able to use setbufvar() instead.
Now, before anyone yells :diffoff!, don't. It does silly things, such
as turning on 'wrap', setting 'fdm' to manual. It also doesn't apply
to all buffers.
Regards,
Henrik.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---