Bug report: 'scrollbind' breaks when using mouse in xterm window

30 views
Skip to first unread message

Jason Franklin

unread,
May 19, 2018, 12:23:07 PM5/19/18
to vim_dev
Reproduce as follows (I used Gnome Terminal):

vim -u NONE
:set mouse=a
:e [name of long file]
:vsp
:windo set scrollbind

Now, use the mouse wheel to try and scroll in both windows. The window with
cursor focus will scroll both windows properly, but not the other window,
thus breaking the 'scrollbind' setting.

Unlike with my other patches, I don't see an obvious way to fix this issue
and test it properly, so I figured I'd just report it and hope someone else
picked it up.

Thanks for 8.1, by the way. It's a treat!

Bram Moolenaar

unread,
May 19, 2018, 12:36:04 PM5/19/18
to vim...@googlegroups.com, Jason Franklin
This is intentional. Previously it only worked this way in the GUI, bit
since most users like it the terminal was also made to work like this.

> Thanks for 8.1, by the way. It's a treat!

Enjoy!



--
Mynd you, m00se bites Kan be pretty nasti ...
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Marius Gedminas

unread,
May 20, 2018, 3:17:13 AM5/20/18
to vim_dev
On Sat, May 19, 2018 at 09:23:07AM -0700, Jason Franklin wrote:
> Now, use the mouse wheel to try and scroll in both windows. The window with
> cursor focus will scroll both windows properly, but not the other window,
> thus breaking the 'scrollbind' setting.

This is intentional, to let you adjust the relative offset between the
two windows. The 'scrollbind' option is not reset, and will be used
(with the new relative offset) when you start scrolling the active
window again.

This is documented in :help scroll-binding

When using the scrollbars, the binding only happens when scrolling
the window with focus (where the cursor is). You can use this to
avoid scroll-binding for a moment without resetting options.

and again in :help scrollbind-quickadj

The 'scrollbind' flag is meaningful when using keyboard commands to
vertically scroll a window, and also meaningful when using the
vertical scrollbar of the window which has the cursor focus.
However, when using the vertical scrollbar of a window which doesn't
have the cursor focus, 'scrollbind' is ignored. This allows quick
adjustment of the relative offset of 'scrollbind' windows.

Both places should probably be updated to also mention the mouse wheel.

Marius Gedminas
--
It is easier to optimize correct code than to correct optimized code.
-- Bill Harlan
signature.asc

Jason Franklin

unread,
May 20, 2018, 8:12:33 AM5/20/18
to vim_dev
Thanks Marius!

> Both places should probably be updated to also mention the mouse wheel.

I see now that my initial idea was mistaken. However, I noted in an email
directly to Bram that gvim on Microsoft Windows does not obey this behavior.
That is, both windows are scrolled regardless of which window has cursor focus.
Apparently this cannot be changed.

I agree that both places in the documentation should be updated to mention the
mousewheel, but I'm not sure about how to explain the MS Windows issue in the
docs.

Reply all
Reply to author
Forward
0 new messages