Sublime Forum

"Redo" does not scroll to change / Bad Scroll Jump on "Redo"

#1

“Redo” jumps to where your last scroll position was, not to where the change occurred.

Frequently while typing, I’ll think of something and scroll to look at some code elsewhere in the file. When I’m done doing this, I’ll use “Undo” to jump to what I was last doing ro remember what I was working on, and then “Redo” to redo the change and continue where I left off.

Unfortunately, b/c I had scrolled away, the “Redo” in the “Undo” => “Redo” combo, doesn’t take me to where the “Redo” occurred (in this case, leaving me where I already am from the “Undo” jump), but instead to where I had scrolled away, which can be incredibly frustrating as I have no idea what the “Redo” (or the original “Undo”) even does b/c either I’m not looking at it when I “Undo” or I jump away before the “Redo” is applied.

0 Likes

Soft undo
Redo: Impossible to see redone changes
Undo and redo
#2

Have you tried using cmd+u as a workaround? (soft undo)

0 Likes

#3

@adzenith No dice. Does nothing different. See below. :-/

Cross-Post / Related to: Soft undo

It is maddening to not be able to see what undo/redo are doing b/c page position / scroll is remembered, but apparently has since been updated. I think it’s caused by undoing, scrolling (and clicking I think), then redo’ing. Now when you undo, it takes you to your scroll position, not the modify position and it is nearly impossible to figure out where the change is occurring…

0 Likes

#4

This is really an important problem for me. I am glad to see someone else has this problem and I am not just crazy.

I am wondering if there is enough information available from the Python interface (which I have not looked at yet) and a enough capability to implement a custom undo/redo. Does anyone else know if this is possible?

0 Likes

#5

I’ll put in another vote on this issue as I’ve seen it occasionally as well, when I am traversing my undo path to get a handle on what modifications I was making on a view when I come back to it after a while. Usually git is able to help me out if I’ve committed recently enough but it’s incredibly disorienting when the cursor is nowhere to be seen and you’re left guessing and confused.

I haven’t found myself in this situation enough (as I think it is a subconcious impulse to attempt not to repeat the actions that lead up to this sort of confusing and negative experience) but my guess is that a quick workaround may be to use the arrow keys after being in this state to identify and focus the cursor again, and that should also not affect the undo buffer state either.

It does not look like the undo function is exposed anywhere for us (it is not a Default package script). There is a chance that we can build a plugin which will define a command that calls undo and then scrolls the cursor or selection back into view. Then we can bind Super+Z/Super+Shift+Z to that instead. For some reason the scrolling being restored is incorrect and we can force it back to the position of the selection because that’s what we really care about anyway, to have it scroll to wherever the cursor is (which should be following the changes).

Update: I think that this will totally not work either, because on the redo it tends to restore and scroll to the incorrect cursor location while the change itself is applied where it originally is (but we no longer know where the hell that is at this point). Very frustrating and I know of no hacky plugin way to achieve this short of somehow pulling out the actual change in the buffer and forcing our cursor over to that, overriding the redo functionality which is placing the cursor in the location that we had navigated to at that point in the history.

0 Likes

#6

This is the main gripe I have with Sublime. Undoing without being able to see what is being undone is infuriating.

0 Likes

#7

This will be fixed in tomorrows dev build

0 Likes