Handle error checker toggle

This commit is contained in:
Jakub Valtar
2015-09-30 09:50:16 -04:00
parent 3208e6f5b5
commit 65059c6183
2 changed files with 5 additions and 5 deletions

View File

@@ -2729,13 +2729,14 @@ public class JavaEditor extends Editor {
}
@Override
protected void applyPreferences() {
super.applyPreferences();
if (jmode != null) {
jmode.loadPreferences();
Messages.log("Applying prefs");
// trigger it once to refresh UI
errorCheckerService.request();
errorCheckerService.handleErrorCheckingToggle();
}
}

View File

@@ -275,7 +275,6 @@ public class ErrorCheckerService {
astGenerator.buildAST(lastCodeCheckResult.sourceCode,
lastCodeCheckResult.compilationUnit);
}
handleErrorCheckingToggle();
while (running) {
try {
@@ -1556,10 +1555,10 @@ public class ErrorCheckerService {
return new String(p2, 0, index);
}
public void handleErrorCheckingToggle() {
if (!JavaMode.errorCheckEnabled) {
Messages.log(editor.getSketch().getName() + " Error Checker paused.");
//editor.clearErrorPoints();
Messages.log(editor.getSketch().getName() + " Error Checker disabled.");
editor.getErrorPoints().clear();
lastCodeCheckResult.problems.clear();
updateErrorTable(Collections.<Problem>emptyList());
@@ -1567,7 +1566,7 @@ public class ErrorCheckerService {
editor.getTextArea().repaint();
editor.repaintErrorBar();
} else {
Messages.log(editor.getSketch().getName() + " Error Checker resumed.");
Messages.log(editor.getSketch().getName() + " Error Checker enabled.");
request();
}
}