fix(gui): use correct offset for code line (#1141)

This commit is contained in:
Skylot
2021-04-01 19:14:48 +01:00
parent 6fe762aa7b
commit 766e7193b9
2 changed files with 5 additions and 1 deletions
@@ -140,6 +140,10 @@ public class StringRef implements CharSequence {
return list;
}
public int getOffset() {
return offset;
}
public int hashCode() {
int h = hash;
int len = length;
@@ -91,7 +91,7 @@ public class TextSearchIndex {
JavaNode node = linesInfo.getJavaNodeByLine(lineNum);
JavaNode javaNode = node == null ? cls : node;
JNode nodeAtLine = nodeCache.makeFrom(javaNode);
codeIndex.put(new CodeNode(nodeAtLine, line, lineNum, javaNode.getDefPos()));
codeIndex.put(new CodeNode(nodeAtLine, line, lineNum, line.getOffset()));
}
} catch (Exception e) {
LOG.warn("Failed to index class: {}", cls, e);