Skip to content

Commit

Permalink
nano syntaxHighlighter: removed obsolate code
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Jul 31, 2019
1 parent 6125492 commit bd6bbb1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions builtins/src/main/java/org/jline/builtins/Nano.java
Original file line number Diff line number Diff line change
Expand Up @@ -1300,10 +1300,6 @@ public void reset() {
ruleStartId = 0;
}

public boolean hasRules() {
return !rules.isEmpty();
}

public AttributedString highlightNextLine(String line) {
return highlightNextLine(new AttributedString(line));
}
Expand All @@ -1327,18 +1323,17 @@ public AttributedString highlightNextLine(AttributedString line) {
Matcher end = rule.getEnd().matcher(asb.toAttributedString());
while (!done) {
AttributedStringBuilder a = new AttributedStringBuilder();
AttributedString l = asb.toAttributedString();
if (ruleStartId == i) { // first rule should never be type
// START_END or we will fail here!
if (end.find()) {
a.append(l.columnSubSequence(0, end.end()),rule.getStyle());
a.append(asb.columnSubSequence(0, end.end()),rule.getStyle());
a.append(asb.columnSubSequence(end.end(), asb.length()));
asb = a;
ruleStartId = 0;
} else {
asb = a.append(l, rule.getStyle());
a.append(asb, rule.getStyle());
done = true;
}
asb = a;
} else {
if (start.find()) {
a.append(asb.columnSubSequence(0, start.start()));
Expand Down

0 comments on commit bd6bbb1

Please sign in to comment.