mirror of
https://github.com/nushell/nushell.git
synced 2024-11-26 18:33:50 +01:00
Harden highlighter against alias spans (#867)
This commit is contained in:
parent
fd9e380a1e
commit
e11ac9f6f8
@ -27,7 +27,10 @@ impl Highlighter for NuHighlighter {
|
||||
let mut last_seen_span = global_span_offset;
|
||||
|
||||
for shape in &shapes {
|
||||
if shape.0.end <= last_seen_span {
|
||||
if shape.0.end <= last_seen_span
|
||||
|| last_seen_span < global_span_offset
|
||||
|| shape.0.start < global_span_offset
|
||||
{
|
||||
// We've already output something for this span
|
||||
// so just skip this one
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user