mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 02:20:45 +01:00
prevent errors on first line of a new tab from highlighting on previous tab
This commit is contained in:
@@ -285,7 +285,9 @@ public class JavaBuild {
|
||||
// then search through for anyone else whose preprocName is null,
|
||||
// since they've also been combined into the main pde.
|
||||
int errorFile = findErrorFile(errorLine);
|
||||
// System.out.println("error line is " + errorLine + ", file is " + errorFile);
|
||||
errorLine -= sketch.getCode(errorFile).getPreprocOffset();
|
||||
// System.out.println(" preproc offset for that file: " + sketch.getCode(errorFile).getPreprocOffset());
|
||||
|
||||
// System.out.println("i found this guy snooping around..");
|
||||
// System.out.println("whatcha want me to do with 'im boss?");
|
||||
@@ -543,7 +545,7 @@ public class JavaBuild {
|
||||
protected int findErrorFile(int errorLine) {
|
||||
for (int i = sketch.getCodeCount() - 1; i > 0; i--) {
|
||||
SketchCode sc = sketch.getCode(i);
|
||||
if (sc.isExtension("pde") && (sc.getPreprocOffset() < errorLine)) {
|
||||
if (sc.isExtension("pde") && (sc.getPreprocOffset() <= errorLine)) {
|
||||
// keep looping until the errorLine is past the offset
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ public class PdePreprocessor {
|
||||
"values (not variables) for the size() command.\n" +
|
||||
"See the size() reference for an explanation.";
|
||||
Base.showWarning("Could not find sketch size", message, null);
|
||||
new Exception().printStackTrace(System.out);
|
||||
// new Exception().printStackTrace(System.out);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -563,6 +563,7 @@ public class PdePreprocessor {
|
||||
write(program, stream), programImports);
|
||||
}
|
||||
|
||||
|
||||
static String substituteUnicode(String program) {
|
||||
// check for non-ascii chars (these will be/must be in unicode format)
|
||||
char p[] = program.toCharArray();
|
||||
@@ -688,6 +689,7 @@ public class PdePreprocessor {
|
||||
|
||||
return className;
|
||||
}
|
||||
|
||||
|
||||
private PdeRecognizer createParser(final String program) {
|
||||
// create a lexer with the stream reader, and tell it to handle
|
||||
|
||||
Reference in New Issue
Block a user