mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 21:59:20 +01:00
Update status error/warning when changing the line
This commit is contained in:
@@ -167,6 +167,12 @@ public class JavaEditor extends Editor {
|
||||
|
||||
public void windowGainedFocus(WindowEvent e) { }
|
||||
});
|
||||
|
||||
textarea.addCaretListener(new CaretListener() {
|
||||
public void caretUpdate(CaretEvent e) {
|
||||
errorCheckerService.updateEditorStatus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -953,13 +953,18 @@ public class ErrorCheckerService {
|
||||
if (errorMarker != null) {
|
||||
if (errorMarker.getType() == LineMarker.WARNING) {
|
||||
editor.statusMessage(errorMarker.getProblem().getMessage(),
|
||||
EditorStatus.WARNING);
|
||||
EditorStatus.CURSOR_LINE_WARNING);
|
||||
} else {
|
||||
editor.statusMessage(errorMarker.getProblem().getMessage(),
|
||||
EditorStatus.COMPILER_ERROR);
|
||||
EditorStatus.CURSOR_LINE_ERROR);
|
||||
}
|
||||
} else {
|
||||
editor.statusEmpty(); // No error, clear the status
|
||||
switch (editor.getStatusMode()) {
|
||||
case EditorStatus.CURSOR_LINE_ERROR:
|
||||
case EditorStatus.CURSOR_LINE_WARNING:
|
||||
editor.statusEmpty();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user