Update reedline, revert crossterm (#4657)

At the moment `crossterm` apparently has a regression decoding certain important key combinations on Windows.
Thus reedline reverted to the previous version.

Some changes are necessary to remove the need for `crossterm` in the use of `lscolors`.
Introduces two local conversion traits.

Additionally update the `Highlighter` API to support the cursor
position.
This will enable brace/statement match highlighting.
This commit is contained in:
Stefan Holderbach
2022-02-26 18:23:05 +01:00
committed by GitHub
parent d2bd71d2aa
commit 799fa98411
9 changed files with 98 additions and 103 deletions

View File

@ -40,7 +40,7 @@ impl Command for NuHighlight {
input.map(
move |x| match x.as_string() {
Ok(line) => {
let highlights = highlighter.highlight(&line);
let highlights = highlighter.highlight(&line, line.len());
Value::String {
val: highlights.render_simple(),

View File

@ -12,7 +12,7 @@ pub struct NuHighlighter {
}
impl Highlighter for NuHighlighter {
fn highlight(&self, line: &str) -> StyledText {
fn highlight(&self, line: &str, _cursor: usize) -> StyledText {
trace!("highlighting: {}", line);
let (shapes, global_span_offset) = {