Commit 1272ae2d authored by Skylot's avatar Skylot

fix(gui): don't skip indexing code lines starting with '}' (#426)

parent ddaf0375
...@@ -69,7 +69,10 @@ public class TextSearchIndex { ...@@ -69,7 +69,10 @@ public class TextSearchIndex {
int count = lines.size(); int count = lines.size();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
StringRef line = lines.get(i); StringRef line = lines.get(i);
if (line.length() != 0 && line.charAt(0) != '}') { int lineLength = line.length();
if (lineLength == 0 || (lineLength == 1 && line.charAt(0) == '}')) {
continue;
}
int lineNum = i + 1; int lineNum = i + 1;
JavaNode node = linesInfo.getJavaNodeByLine(lineNum); JavaNode node = linesInfo.getJavaNodeByLine(lineNum);
CodeNode codeNode = new CodeNode(nodeCache.makeFrom(node == null ? cls : node), lineNum, line); CodeNode codeNode = new CodeNode(nodeCache.makeFrom(node == null ? cls : node), lineNum, line);
...@@ -79,7 +82,6 @@ public class TextSearchIndex { ...@@ -79,7 +82,6 @@ public class TextSearchIndex {
codeIndex.put(line.toString(), codeNode); codeIndex.put(line.toString(), codeNode);
} }
} }
}
} catch (Exception e) { } catch (Exception e) {
LOG.warn("Failed to index class: {}", cls, e); LOG.warn("Failed to index class: {}", cls, e);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment