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

Fix undo (CTRL + Z) and redo for inserting an entry #9777

Merged
merged 9 commits into from
May 7, 2023
16 changes: 10 additions & 6 deletions src/main/java/org/jabref/gui/undo/CountingUndoManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ public synchronized boolean addEdit(UndoableEdit edit) {

@Override
public synchronized void undo() throws CannotUndoException {
super.undo();
current--;
postUndoRedoEvent();
if (canUndo()) {
super.undo();
current--;
postUndoRedoEvent();
}
Siedlerchr marked this conversation as resolved.
Show resolved Hide resolved
}

@Override
public synchronized void redo() throws CannotUndoException {
super.redo();
current++;
postUndoRedoEvent();
if (canRedo()) {
super.redo();
current++;
postUndoRedoEvent();
}
}

public synchronized void markUnchanged() {
Expand Down