mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Working JavaError again without full highlight.
This commit is contained in:
@@ -147,15 +147,11 @@ public class PdeTextAreaPainter extends TextAreaPainter {
|
||||
protected void paintErrorLine(Graphics gfx, int line, int x) {
|
||||
List<Problem> problems = getEditor().findProblems(line);
|
||||
for (Problem problem : problems) {
|
||||
System.out.println("here");
|
||||
int lineOffsetStart = textArea.getLineStartOffset(line);
|
||||
int lineOffsetStop = textArea.getLineStopOffset(line);
|
||||
|
||||
int startOffset = lineOffsetStart + problem.getStartOffset();
|
||||
int stopOffset = lineOffsetStart + problem.getStopOffset();
|
||||
|
||||
int wiggleStart = Math.max(startOffset, lineOffsetStart);
|
||||
int wiggleStop = Math.min(stopOffset, lineOffsetStop);
|
||||
int wiggleStart = lineOffsetStart + problem.getStartOffset();
|
||||
int wiggleStop = lineOffsetStart + problem.getStopOffset();
|
||||
|
||||
int y = textArea.lineToY(line) + getLineDisplacement();
|
||||
|
||||
|
||||
@@ -2633,8 +2633,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
int lineOffset = textarea.getLineStartOffset(pStartLine);
|
||||
int pEndOffset = lineOffset + p.getStopOffset();
|
||||
int pEndLine = textarea.getLineOfOffset(pEndOffset);
|
||||
|
||||
System.out.println(line + "\t" + pStartLine + "\t" + pEndLine);
|
||||
|
||||
return line >= pStartLine && line <= pEndLine;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -199,7 +199,7 @@ public class ErrorChecker {
|
||||
String badCode = ps.getPdeCode(in);
|
||||
int line = ps.tabOffsetToTabLine(in.tabIndex, in.startTabOffset);
|
||||
JavaProblem p = JavaProblem.fromIProblem(iproblem, in.tabIndex, line, badCode);
|
||||
p.setPDEOffsets(in.startTabOffset, in.stopTabOffset);
|
||||
p.setPDEOffsets(0, 1); // TODO
|
||||
return p;
|
||||
}
|
||||
return null;
|
||||
@@ -252,7 +252,6 @@ public class ErrorChecker {
|
||||
|
||||
String message = Language.interpolate("editor.status.bad_curly_quote", q);
|
||||
JavaProblem problem = new JavaProblem(message, JavaProblem.ERROR, tabIndex, tabLine);
|
||||
problem.setPDEOffsets(tabOffset, tabOffset+1);
|
||||
|
||||
problems.add(problem);
|
||||
}
|
||||
@@ -294,7 +293,6 @@ public class ErrorChecker {
|
||||
message = Language.interpolate("editor.status.bad_curly_quote", q);
|
||||
}
|
||||
JavaProblem p = new JavaProblem(message, JavaProblem.ERROR, in.tabIndex, line);
|
||||
p.setPDEOffsets(tabStart, tabStop);
|
||||
problems2.add(p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,10 @@ public class JavaProblem implements Problem {
|
||||
this.type = type;
|
||||
this.tabIndex = tabIndex;
|
||||
this.lineNumber = lineNumber;
|
||||
|
||||
// Default to 0, 1 unless a longer section is specified
|
||||
this.startOffset = 0;
|
||||
this.stopOffset = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user