Skip to content
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

Feature request - undo after moving cursor should optionally just put the cursor back, without undoing #34093

Open
Madd0g opened this issue Sep 10, 2017 · 10 comments
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality undo-redo Issues around undo/redo
Milestone

Comments

@Madd0g
Copy link

Madd0g commented Sep 10, 2017

There's a feature I'm missing that I've used in other IDE's, when finishing typing, moving somewhere else (for example to select+copy some variable name), then pressing CMD+Z should bring the cursor back to the last edit location without actually undoing the typing there.

I know there's some "last cursor position" keyboard shortcut, but I believe this should be a first-class functionality of the undo, like it is in other editors (I remember this from webstorm, but I'm pretty sure the muscle memory for doing this comes from way before webstorm).

What do you think?
Thanks

  • VSCode Version: 1.16
  • OS Version: OSX 10.11
@alexdima
Copy link
Member

alexdima commented Sep 12, 2017

@Madd0g would cmd+u do the trick for you? It is a "soft undo" that moves the cursor to the last cursor location... Or would you prefer to have undo entries in the undo stack that only move the cursor. That is something that would compete a bit with go back ctrl+- by default.

@alexdima alexdima added the info-needed Issue requires more information from poster label Sep 12, 2017
@Madd0g
Copy link
Author

Madd0g commented Sep 13, 2017

cmd+u doesn't do the trick and even if it did work, I strongly believe it should be built into the undo functionality, like it is with a lot of other editors. It shouldn't remember each cursor move, just if you did move the cursor (even a bunch of times), undo brings you back to where you last typed, without actually removing the typed text.

I believe it's a huge usability boost, even for one single purpose I use this for:

  1. write the start of a function call document.getElementById("
  2. double-click on some word you see on the screen, copy it
  3. cmd+z and paste

I tried using cmd+u where I would usually use cmd+z and it did not work (it worked on second press though).

This process is hardwired into me from many years. I believe this is a more correct behavior simply because what user would want to undo something they (potentially) cannot see? Jumping back to the edit location before actually undoing, in my eyes, is better UX just for that reason.

Thanks

@alexdima alexdima added feature-request Request for new features or functionality editor-core Editor basic functionality and removed info-needed Issue requires more information from poster labels Oct 20, 2017
@alexdima alexdima added this to the Backlog milestone Oct 20, 2017
@alexdima alexdima removed their assignment Oct 20, 2017
@duncanawerbuck
Copy link

duncanawerbuck commented Jul 4, 2019

@Madd0g would cmd+u do the trick for you? It is a "soft undo" that moves the cursor to the last cursor location... Or would you prefer to have undo entries in the undo stack that only move the cursor. That is something that would compete a bit with go back ctrl+- by default.

@Madd0g, can you (or anyone else) please clarify the difference between go back and soft undo?

@wenfangdu
Copy link
Contributor

wenfangdu commented Nov 9, 2019

@duncanawerbuck In my experience, soft undo resets every cursor movement, go back won't if it's just a up/down or ctrl+left/right etc. it resets in the page level, like change active file, or page up/down, give them a try, you will see.
btw. soft undo is renamed to cursor undo now

@Mannibaer
Copy link

Mannibaer commented Jan 18, 2020

What's the current state of the requested feature? I also agree with @Madd0g, this feature would highly increase the UX of every developer!

@alexdima alexdima added the undo-redo Issues around undo/redo label Feb 26, 2020
@PepperAndSalt
Copy link

I want this feature so badly!

@kyle-mallah
Copy link

The lack of this feature makes undo/redo uninformative and error prone.

When 'ctrl-z' causes the page to scroll and undo at the same time, it's impossible to see what was undone without redoing and undoing it. I see myself constantly having to undo-redo-undo so that I can see what was actually changed on the first undo. This is also error prone as if you mistype one of the shortcuts, you wipe your undo/redo history and you're left wondering what you may (or may not) have changed

@mathieuprog
Copy link

It's a hard switch from IntelliJ to VS Code without this feature honestly. Devs are constantly scrolling through files. I feel more confident to undo when at first I get back to the cursor position where something can be undone, and only the second action will undo. I find myself constantly undo-ing/redo-ing with VS Code.

@Leo7654
Copy link

Leo7654 commented Mar 21, 2022

+1

@holazz
Copy link
Contributor

holazz commented Apr 8, 2022

Just switched from WebStorm to VS Code, I desperately want this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality undo-redo Issues around undo/redo
Projects
None yet
Development

No branches or pull requests