mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
sweet joys of trimming code
This commit is contained in:
@@ -1488,71 +1488,6 @@ public class ErrorCheckerService implements Runnable{
|
||||
}
|
||||
}
|
||||
|
||||
/*public void scrollToErrorLine(Problem p) {
|
||||
if (editor == null) {
|
||||
return;
|
||||
}
|
||||
if (p == null)
|
||||
return;
|
||||
try {
|
||||
editor.toFront();
|
||||
editor.getSketch().setCurrentCode(p.getTabIndex());
|
||||
|
||||
editor
|
||||
.setSelection(editor.getTextArea()
|
||||
.getLineStartNonWhiteSpaceOffset(p.getLineNumber() - 1)
|
||||
+ editor.getTextArea()
|
||||
.getLineText(p.getLineNumber() - 1).trim().length(),
|
||||
editor.getTextArea()
|
||||
.getLineStartNonWhiteSpaceOffset(p.getLineNumber() - 1));
|
||||
editor.getTextArea().scrollTo(p.getLineNumber() - 1, 0);
|
||||
editor.repaint();
|
||||
} catch (Exception e) {
|
||||
System.err.println(e
|
||||
+ " : Error while selecting text in scrollToErrorLine()");
|
||||
e.printStackTrace();
|
||||
}
|
||||
// log("---");
|
||||
}*/
|
||||
|
||||
/*public void scrollToErrorLine(Problem p) {
|
||||
if (editor == null) {
|
||||
return;
|
||||
}
|
||||
if (p == null)
|
||||
return;
|
||||
try {
|
||||
int pkgNameOffset = ("package " + className + ";\n").length();
|
||||
int prbStart = p.getIProblem().getSourceStart() - pkgNameOffset, prbEnd = p
|
||||
.getIProblem().getSourceEnd() - pkgNameOffset;
|
||||
log("Scrolling to problem: " + p.toString());
|
||||
log("P start: " + prbStart + " to "
|
||||
+ prbEnd + " pkgOffset " + pkgNameOffset);
|
||||
int lineNumber = p
|
||||
.getIProblem().getSourceLineNumber()-1;
|
||||
Element lineElement = astGenerator.getJavaSourceCodeElement(lineNumber);
|
||||
log("Line element off " + lineElement.getStartOffset());
|
||||
OffsetMatcher ofm = new OffsetMatcher(
|
||||
astGenerator
|
||||
.getPDESourceCodeLine(lineNumber),
|
||||
astGenerator
|
||||
.getJavaSourceCodeLine(lineNumber));
|
||||
//log("");
|
||||
int pdeOffset = ofm.getPdeOffForJavaOff(prbStart
|
||||
- lineElement.getStartOffset(), (prbEnd - p
|
||||
.getIProblem().getSourceStart()));
|
||||
astGenerator.highlightPDECode(p.getTabIndex(), p.getLineNumber()-1,
|
||||
pdeOffset, (prbEnd - prbStart + 1));
|
||||
editor.getTextArea().scrollTo(p.getLineNumber() - 1, 0);
|
||||
editor.repaint();
|
||||
} catch (Exception e) {
|
||||
System.err.println(e
|
||||
+ " : Error while selecting text in scrollToErrorLine()");
|
||||
e.printStackTrace();
|
||||
}
|
||||
// log("---");
|
||||
}*/
|
||||
|
||||
public void scrollToErrorLine(Problem p) {
|
||||
if (editor == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user