Skip to content

Commit 567c772

Browse files
committed
Fixes ExceptionWitness being impossible to scroll
The UI was updating at such a high frequency that it was impossible to scroll the stack trace pane. Now only updates the pane when the stack trace changes.
1 parent 5bbb1dd commit 567c772

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ui/src/main/java/edu/wpi/grip/ui/components/ExceptionWitnessResponderButton.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ private void assignFromExceptionEvent(ExceptionEvent event) {
107107
errorMessage.setText(errorMessageText);
108108
if (event.getException().isPresent()) {
109109
final Exception exception = event.getException().get();
110-
stackTrace.setText(Throwables.getStackTraceAsString(exception));
111-
stackTrace.setVisible(true);
110+
final String exceptionMessage = Throwables.getStackTraceAsString(exception);
111+
// Otherwise it is impossible to scroll the text field because it is updated so frequently
112+
if (!exceptionMessage.equals(stackTrace.getText())) {
113+
stackTrace.setText(exceptionMessage);
114+
}
115+
116+
stackTracePane.setVisible(true);
112117
} else {
113118
stackTracePane.setVisible(false);
114119
stackTrace.setText("");

0 commit comments

Comments
 (0)