mirror of
https://github.com/nushell/nushell
synced 2025-01-13 21:55:07 +00:00
Harden highlighter against alias spans (#867)
This commit is contained in:
parent
fd9e380a1e
commit
e11ac9f6f8
1 changed files with 4 additions and 1 deletions
|
@ -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 a new issue