Closed snuyanzin closed 6 years ago
such code snippet inside org.jline.builtins.Commands#history
helps
Highlighter highlighter = reader.getHighlighter();
for (History.Entry entry : history) {
...
sb.append(highlighter.highlight(reader, entry.line()));
...
}
Please let me know if there is anything I could miss
Yes, that should be fine. The LineReader
also uses a MaskingCallback
, but the history should be filtered already, so there's no need to handle that when displaying.
Feel free to provide a Pull Request to make the history command nicer :-)
Could you please tell if there is a way to use the same highlighters for history output (to highlight each history record individually) as for
LineReader
?