Hi! I previously proposed a similar change in Neovim (neovim/neovim#38943), but it wasn’t accepted there. I’m opening it here as it may be more appropriate for Vim itself.
Happy to adjust or drop this if it doesn’t align with Vim’s intended behavior. I'll leave another description below.
Alt+click/drag in Visual Block mode expands the selection relative to the furthest corner of the existing block, rather than the position where the drag started.
Update the selection anchor to the position of the initial click, so that dragging behaves consistently with standard mouse-based visual selections (left-click/drag).
The current behavioris from 6496966 for reference.
| Before | After |
|---|---|
| before.gif (view on web) | after.gif (view on web) |
https://github.com/vim/vim/pull/19957
(4 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@fmgornick pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I don't understand what is the reasoning behind changing this? Why now and why change only the Alt modifier? Note: that this might be a slightly backwards incompatible change. Also, wouldn't that be slightly inconsistent between the terminal and Gui versions of Vim?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra Yeah that's totally fair, backwards incompatibility is a real concern and I understand if that's a pass on its own.
The motivation is that regular visual-mode highlighting already works intuitively with left click: you click and drag, and it selects the area between the two points. Since alt-click+drag does blockwise selection, it feels like it should follow the same mental model: alt-click+drag fills the rectangular block region between the two points, rather than the current behavior. It's making the alt modifier consistent with how the non-alt case works.
On the terminal vs GUI question: alt-click is already an existing feature in terminal Vim, so this change isn't introducing a new inconsistency between the two, it's just modifying behavior that's already present in both codepaths.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
So if I understand correctly, you are proposing that Alt-click will always restart a new block selection, instead of trying to extend the existing one, right? Also what I mean with the Gui version is, how does it behave in a GUI? Does Alt-click also re-sizes the block selection? Or does it do the restart block selection? Just want to make sure the behaviour beween a terminal Vim and in a GUI vim is consistent.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
let's not do it, sorry
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()