-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Milestone
Description
Originally reported at #11282 (comment)
An exception is thrown when trying to use Ctrl+Z on any text field in the entry editor.
2024-06-19 06:13:03 [JavaFX Application Thread] org.jabref.gui.FallbackExceptionHandler.uncaughtException()
ERROR: Uncaught exception occurred in Thread[#54,JavaFX Application Thread,5,main]: java.lang.NullPointerException: Cannot read field "next" because "this.undoChange" is null
at [email protected]/javafx.scene.control.TextInputControl.updateUndoRedoState(TextInputControl.java:1250)
A work-around is to disable the key combinations Ctrl+Z and Ctrrl+Y for the field:
// We need to consume the key event to avoid the default behavior of undo/redo and enable JabRef's undo/redo
// Source: https://stackoverflow.com/a/37575818/873282
textInputControl.addEventFilter(KeyEvent.ANY, e -> {
if (e.getCode() == KeyCode.Z && e.isShortcutDown()) {
e.consume();
}
});However, the undo/redo should still work. I went through the code a bit, but org.jabref.gui.frame.JabRefFrame.UndoRedoEventManager#updateTexts is "dead" code and I don't know further (yet).
Metadata
Metadata
Assignees
Labels
No labels