Assign spans to raw.line
(#2672)
This commit is contained in:
parent
d16ab29068
commit
c427ca9e4e
@ -325,12 +325,15 @@ impl Synthesize for RawElem {
|
|||||||
synt::Highlighter::new(theme),
|
synt::Highlighter::new(theme),
|
||||||
&mut |_, range, style| styled(&text[range], foreground, style),
|
&mut |_, range, style| styled(&text[range], foreground, style),
|
||||||
&mut |i, range, line| {
|
&mut |i, range, line| {
|
||||||
seq.push(RawLine::new(
|
seq.push(
|
||||||
i + 1,
|
RawLine::new(
|
||||||
count,
|
i + 1,
|
||||||
EcoString::from(&text[range]),
|
count,
|
||||||
Content::sequence(line.drain(..)),
|
EcoString::from(&text[range]),
|
||||||
));
|
Content::sequence(line.drain(..)),
|
||||||
|
)
|
||||||
|
.spanned(self.span()),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.highlight();
|
.highlight();
|
||||||
@ -353,12 +356,15 @@ impl Synthesize for RawElem {
|
|||||||
line_content.push(styled(piece, foreground, style));
|
line_content.push(styled(piece, foreground, style));
|
||||||
}
|
}
|
||||||
|
|
||||||
seq.push(RawLine::new(
|
seq.push(
|
||||||
i as i64 + 1,
|
RawLine::new(
|
||||||
count,
|
i as i64 + 1,
|
||||||
EcoString::from(line),
|
count,
|
||||||
Content::sequence(line_content),
|
EcoString::from(line),
|
||||||
));
|
Content::sequence(line_content),
|
||||||
|
)
|
||||||
|
.spanned(self.span()),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let lines = text.lines();
|
let lines = text.lines();
|
||||||
@ -369,6 +375,7 @@ impl Synthesize for RawElem {
|
|||||||
EcoString::from(line),
|
EcoString::from(line),
|
||||||
TextElem::packed(line),
|
TextElem::packed(line),
|
||||||
)
|
)
|
||||||
|
.spanned(self.span())
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user