mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 18:35:37 +01:00
non white space offset it is
This commit is contained in:
@@ -1603,7 +1603,7 @@ public class ASTGenerator {
|
||||
.getSketch().getCurrentCodeIndex(), originalLN);
|
||||
String javaCodeLine = getJavaSourceCodeline(lineNumber);
|
||||
|
||||
log(originalLN + " PDE :" + pdeCodeLine);
|
||||
log(originalLN + " Original Line num.\nPDE :" + pdeCodeLine);
|
||||
log("JAVA:" + javaCodeLine);
|
||||
log("Clicked on: " + name + " start offset: " + offset);
|
||||
OffsetMatcher ofm = new OffsetMatcher(pdeCodeLine, javaCodeLine);
|
||||
@@ -1611,7 +1611,7 @@ public class ASTGenerator {
|
||||
+ lineNode.getStartPosition();
|
||||
log("JAVA ast offset: " + (javaOffset));
|
||||
dfsLookForASTNode(errorCheckerService.getLatestCU(), name,
|
||||
javaOffset, javaOffset + name.length() - 1);
|
||||
javaOffset, javaOffset + name.length());
|
||||
ASTNode simpName = null;
|
||||
if(simpName == null) return null;
|
||||
// End test
|
||||
@@ -2259,10 +2259,12 @@ public class ASTGenerator {
|
||||
if (temp.getStartPosition() <= startOffset
|
||||
&& (temp.getStartPosition() + temp.getLength()) >= endOffset) {
|
||||
if(temp instanceof SimpleName){
|
||||
log("Found possible simplename: " + getNodeAsString(temp));
|
||||
if(name.equals(temp.toString())){
|
||||
log("Found simplename: " + getNodeAsString(temp));
|
||||
return temp;
|
||||
}
|
||||
log("Bummer, didn't match");
|
||||
}
|
||||
else
|
||||
stack.push(temp);
|
||||
|
||||
@@ -101,7 +101,7 @@ public class TextAreaPainter extends processing.app.syntax.TextAreaPainter {
|
||||
else {
|
||||
int x = ta.xToOffset(line, evt.getX()), x2 = x + 1, x1 = x - 1;
|
||||
log("x="+x);
|
||||
int xLS = off - ta.getLineStartOffset(line);
|
||||
int xLS = off - ta.getLineStartNonWhiteSpaceOffset(line);
|
||||
if (x < 0 || x >= s.length())
|
||||
return;
|
||||
String word = s.charAt(x) + "";
|
||||
|
||||
Reference in New Issue
Block a user