How to "undo" `cmd-d`?


#1

I am editing a function. I want to rename the variable foo to bar in it. So I go to the beginning of the function and hit cmd-d. Good. So I type cmd-d again. Ah! It highlights the second occurrence. Good. So I keep hitting cmd-d.

Oh no! I just overshot! Now it marked a foo that is outside the current function!

What do I do to “undo” the last cmd-d?


#2

Try text pastry


#3

I approve of this illustrative method of replication instructions.


#4

It works very nicely. Thanks a bunch!


#5

Just for reference: this is built-in functionality now. Press cmd-u (macOS) or ctrl-u (other platforms).