Questions tagged [undo-redo]

For issues relating to undo and/or redo operations.

In graphical use interfaces, Undo is a command used to erase the last (text or command) change done to the document reverting it to an older state. Redo is a command that reverses the undo or advances the buffer to a more current state.

Common key bindings for undo include Ctrl+Z or Command-Z, and common key bindings for redo include Ctrl+Y or Command-Shift-Z.

389 questions
300
votes
11 answers

How do you 'redo' changes after 'undo' with Emacs?

This article says that "Emacs has redo because you can reverse direction while undoing, thereby undoing the undo". What does this mean? How can a user 'redo' with Emacs?
prosseek
  • 182,215
  • 215
  • 566
  • 871
177
votes
6 answers

How to go back (ctrl+z) in vi/vim

In normal text editors [with all due respect to Vim] there is a shortcut Ctrl+Z when you have done something nasty and want to return to the previous version of the text. Like BACK button in Word. I wonder how can you achieve this behaviour in Vim.
Slazer
  • 4,750
  • 7
  • 33
  • 60
166
votes
2 answers

How to configure IntelliJ (also Android Studio) redo shortcut to CTRL+Y instead of CTRL+SHIFT+Z?

The default IntelliJ / Android Studio "Redo" action shortcut is CTRL+Shift+Z and this is a common problem for Windows users. A bigger problem is CTRL+Y is mapped to the "Delete line" action - and this causes the undo stack to be lost. To solve this…
Ismail Yavuz
  • 6,727
  • 6
  • 29
  • 50
141
votes
4 answers

NSInvocation for Dummies?

How exactly does NSInvocation work? Is there a good introduction? I’m specifically having issues understanding how the following code (from Cocoa Programming for Mac OS X, 3rd Edition) works, but then also be able to apply the concepts independently…
John Rudy
  • 37,282
  • 14
  • 64
  • 100
107
votes
4 answers

Using Vim's persistent undo?

One of the new features in Vim 7.3 is 'persistent undo', which allows for the undotree to be saved to a file when exiting a buffer. Unfortunately, I haven't quite been able to get it properly enabled, or I must be using it wrong. Here's what I've…
duckworthd
  • 14,679
  • 16
  • 53
  • 68
58
votes
5 answers

Android Studio undo (Ctrl-Z) / redo (Ctrl-Y) not working

I've just moved from Eclipse to Android Studio and am finding really weird behaviour when I try to do Ctrl+Z / Ctrl+Y to undo/redo code changes. It hard to describe what happens exactly, but the end result is that I usually end up just losing my…
ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253
53
votes
5 answers

data structure used to implement UNDO and REDO option

I want to implement UNDO and REDO option(as we see in MS word etc). Can you suggest me a data structure for it, and how can i implement it.?
SyncMaster
  • 9,754
  • 34
  • 94
  • 137
40
votes
15 answers

How can you add a UIGestureRecognizer to a UIBarButtonItem as in the common undo/redo UIPopoverController scheme on iPad apps?

Problem In my iPad app, I cannot attach a popover to a button bar item only after press-and-hold events. But this seems to be standard for undo/redo. How do other apps do this? Background I have an undo button (UIBarButtonSystemItemUndo) in the…
SG.
  • 401
  • 1
  • 5
  • 3
32
votes
8 answers

How to implement good and efficient undo/redo functionality for a TextBox

I have a TextBox which I would like to implement undo/redo functionality for. I have read that it might have some slight undo functionality already, but that it is buggy? Anyways, I would like to implement both undo and redo functionality also just…
Svish
  • 152,914
  • 173
  • 462
  • 620
28
votes
5 answers

Best practice for Undo Redo implementation in C#

I need to implement Undo/Redo frame work for my window application(editor like powerpoint), what should be the best practice to follow, how would be handle all property changes of my objects and it reflection on UI.
Firoz
  • 7,224
  • 10
  • 41
  • 56
26
votes
5 answers

How to add undo / redo buttons to toolbar in Eclipse?

I feel a bit embarrassed asking this questions, but how the heck can I get regular undo/redo buttons into the toolbar of eclipse? I've often to switch between German and English keyboard layout. Y and Z on those layouts is interchanged and thus I…
mark
  • 6,308
  • 8
  • 46
  • 57
24
votes
1 answer

How to make a undo/redo function

I want to add a undo/redo function in my script. I have looked around and see some suggestions, most of them recommended to use command pattern. The function must work over one page - after a reload of the page the function must able to redo/undo…
RainerS
  • 423
  • 1
  • 4
  • 11
22
votes
3 answers

Is it possible to edit a text input with javascript and add to the Undo stack?

Is there a way to edit the contents of an input or textarea with javascript, and have that change be undo-able with the browser's "undo" command (eg ctrl-Z)? I am trying to insert a string, such as "Foo {0} bar", into the value at the selection, and…
Mar
  • 7,765
  • 9
  • 48
  • 82
17
votes
8 answers

How to design undo & redo in text editor?

Part of my project is to write a text editor that is used for typing some rules, compiling my application and running it. Writing compiler was end and release beta version. In the final version we must add undo and redo to the text editor. I use a…
Sajad Bahmani
  • 17,325
  • 27
  • 86
  • 108
16
votes
3 answers

Implementing undo / redo in Redux

Background For a while now I've been wracking my brain as to how you would implement undo / redo in Redux with server interactions (via ajax). I've come up with a solution using a command pattern where actions are registered with an execute and undo…
1
2 3
25 26