Friday, November 14, 2014

How to scroll then click in inactive window without jumping back?

All,

I normally run Gvim on Linux with two vertically split windows.
Often, I'll be editing in the first window and I want to take a
look at something off-screen in the second window, so I hover my
mouse over the second window and use the scroll wheel to look
around. If I see something interesting in that inactive window
that I'd like to interact with, I try to click in the window and
position the cursor where I'm looking; however, the click causes
the inactive window to first scroll back to its original
position to make the original cursor visible, and only then does
the click take effect. This can be frustrating, as I then need
to find the new location again which may be several pages away.

You can recreate the above scenario by starting Gvim with an
empty buffer, then doing:

; Put 500 lines of "Inactive Window" in one buffer:
500iInactive Window<CR><ESC>

; Split and make an empty buffer
<C-w><C-v>:enew<CR>

; Put 500 lines of "Active Window" in another buffer:
500iActive Window<CR><ESC>

This leave the cursor on line #501 in each window. Now
demonstrate the problem as follows:

; Hover mouse over "Inactive Window" and use scroll wheel
; to scroll back several screens toward line 1.

; Click in Inactive Window.

The inactive window will scroll back to put line #501 back at
the bottom of the screen, and only then the click will be
accepted.

Is there any way to prevent Gvim from scrolling the inactive
window back to the original position before accepting the click?
I've done a bunch of Googling, but I can't seem to hit upon the
right search terms to find anyone discussing this issue (though
I see many people who would like to solve the related problem of
allowing the cursor on the *active* window to go off-screen when
scrolling with the mouse wheel).

Thanks,
Michael Henry

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment