Skip to content

Commit

Permalink
Nano SyntaxHighlighter: extended style syntax with styles bold, faint,
Browse files Browse the repository at this point in the history
italic, ...
  • Loading branch information
mattirn committed Oct 27, 2019
1 parent 7a9396d commit da89fc4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions builtins/src/main/java/org/jline/builtins/Nano.java
Original file line number Diff line number Diff line change
Expand Up @@ -1734,6 +1734,26 @@ private void addHighlightRule(List<String> parts, boolean caseInsensitive) {
if (bcolor != null) {
style = style.background(bcolor);
}
// extended nanorc..
if (styleStrings.length > 2) {
if (styleStrings[2].equals("blink")) {
style = style.blink();
} else if (styleStrings[2].equals("bold")) {
style = style.bold();
} else if (styleStrings[2].equals("conceal")) {
style = style.conceal();
} else if (styleStrings[2].equals("faint")) {
style = style.faint();
} else if (styleStrings[2].equals("hidden")) {
style = style.hidden();
} else if (styleStrings[2].equals("inverse")) {
style = style.inverse();
} else if (styleStrings[2].equals("italic")) {
style = style.italic();
} else if (styleStrings[2].equals("underline")) {
style = style.underline();
}
}

if (HighlightRule.evalRuleType(parts) == HighlightRule.RuleType.PATTERN) {
for (int i = 2; i < parts.size(); i++) {
Expand Down

1 comment on commit da89fc4

@mattirn
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.