-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command to exchange beginning/end of region #4697
Comments
Interesting feature request. I've never used something like this. Seems pretty cool. |
This is already possible by utilizing the If you don't use vim mode, you'll have to bind it to some hotkey. It works even if the selection wasn't made using vim mode. If you do use vim mode the default keybinding for it is |
@quarkw Does it work for the preview version? I just tried but it did not work without vim mode (it did work in vim mode)
|
I'm on the preview version, but ah sorry, it looks like when vim mode is not enabled (settings config), none of the vim commands are available. I tested it in vim mode by selecting with the mouse and it worked. I didn't try disabling vim entirely. With vim mode disabled in the settings So it's not supported for those that don't have vim enabled, but the good news is the code to perform that action should already exist. It just needs to be exposed in a way that it can be called with vim mode disabled. |
We've recently implemented support for an emacs-style mark-mode ( This included support for exchanging the mark and the cursor location (editor::ExchangeMark). Emacs keybind maps these by default to I was unaware of this enhancement request when that was implemented, but it sounds like you would like to have something similar but for normal selections not just mark/selection mode selections so I've implemented that here: Thanks! |
Check for existing issues
Describe the feature
For example,
*
denotes beginning of region,|
denotes end of region (cursor in this case), running the command would turninto
Running the command again would go back to the original state.
This could be helpful for adjusting the (direction of) selections. (For example if one also want to select the
111
line without canceling and selecting again).Also, if no region is selected, calling the command will select / activate the region between current location and last position.
A related command in Emacs is call
exchange-mark-and-point
.If applicable, add mockups / screenshots to help present your vision of the feature
Notice how:
Screen.Recording.2023-07-31.at.14.04.57.mov
The text was updated successfully, but these errors were encountered: