Search code examples
android-studioundoundo-redo

Android Studio undo action is not working globally


When i am doing Ctrl+Z it works only withing currently opened tab (file).

If i change file a.java then switch to file b.java in another tab and do another change then click Ctrl+Z only changes in b.java are undone, but not in a.java unless i swtich back to that tab.

Is there way to change undo to work globally for entire project and not be limited to currently open tab?

So when i press Ctrl+Z in b.java it reverts then i press Ctrl+Z again and it switches to a.java and reverts.


Solution

  • That's by design and cannot be changed as far as I know.

    The advantages are that each file has its own undo buffer and the changes can be undone independently of each other. Also, it allows better control over what exactly it is that is undone - if there would only be one global undo buffer the next action that is undone could be anything. The user won't necessarily remember what that action was, potentially undoing something that shouldn't be undone with no chance of finding out where and what action that was. It could be anywhere when there is only one global undo buffer.