> I've noticed a problem when I have multiple tab pages open, each
> containing two windows that are diff'd, and I execute :diffoff! or
> :tabclose! in one of the tabs.  Either one of those commands resets
> the value of 'scrollopt' from "ver,jump,hor" to "ver,jump".  The
> problem is that 'scrollopt' is a global options, so its reset value
> affects the diffs in all the tab pages, not just the one in which
> :diffoff! or :tabclose! was executed.

The ex_difoff() function removes "hor" from 'scrollopt' when there are
no windows in diff mode in the current tab.

> I encounter this problem frequently when using the Fugitive ":Git
> difftool -y" command and close one of the tabs.  It is not a bug in
> Fugitive; I can reproduce it starting with "$ vim -N -u NONE -i
> NONE -p file1 file2".
> 
> I could execute :diffoff again after :diffoff! as mentioned in
> ":help :diffoff", but that's annoying and not even possible in the
> :tabclose! case.
> 
> Would it be possible to fix this problem, perhaps by doing something
> like making 'scrollopt' tab-local (I know there's currently no such
> thing) or resetting it to "ver,jump" only when no window in any tab
> page is in diff mode?

We don't have tab-local options yet, and implementing them will be some
work.  It's also not clear if we need new commands or that :setlocal
could be used.

We could check in ex_diffoff() if there is a window in another tab still
in diff mode and not remove "hor" from 'scrollopt' then.  I wonder if
that would work for everyone.

-- 
When I die, I want to go peacefully in my sleep like my grandfather.
Not screaming in terror, like his passengers.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230225120018.044B51C0E92%40moolenaar.net.

Raspunde prin e-mail lui