On Thu, 29 Jun 2006 at 2:07pm, Tim Chase wrote: > > The documentation says the 'diff' setting is local to window, so closing > > the windows show cancel the setting out, but when I try the below > > sequence on two related files say, x.old and x.new, it seems otherwise. > > Vim seems to keep the 'diff' information around in the same way > it keeps marks in a given file. Until it's unloaded, it still > seems to remember it. Using :bw seems to obliterate the file so > that the next time it is loaded you don't have 'diff' set. > > I agree that the docs saying that 'diff' is per-window seems a > bit misleading, as it seems to be per-buffer. > > Just my $0.02 observation... > > -tim
I first though the same way, that 'diff' is probably a buffer local setting (instead or in addition to being window local), and so tried to search for buffers with 'diff' value "1" using getbufvar(), but this interestingly returns "1" only when you are in the window for that buffer. What I mean is, say a buffer 600 has 'diff' set. If you are in a window containing a different buffer, and call getbufvar(600, '&diff'), you get "0", but if you are in the window that has buffer 600 visible, you get "1". This obviously means you will never get "1" for a buffer that is not currently visible in any window, so a loop to find the buffer will not work. -- Thanks, Hari __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
