mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
ignore empty virtual text layers
This commit is contained in:
parent
3abc07a79e
commit
a17b008b42
@ -334,7 +334,9 @@ pub fn add_inline_annotations(
|
||||
layer: &'a [InlineAnnotation],
|
||||
highlight: Option<Highlight>,
|
||||
) -> &mut Self {
|
||||
self.inline_annotations.push((layer, highlight).into());
|
||||
if !layer.is_empty() {
|
||||
self.inline_annotations.push((layer, highlight).into());
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
@ -349,7 +351,9 @@ pub fn add_inline_annotations(
|
||||
/// If multiple layers contain overlay at the same position
|
||||
/// the overlay from the layer added last will be show.
|
||||
pub fn add_overlay(&mut self, layer: &'a [Overlay], highlight: Option<Highlight>) -> &mut Self {
|
||||
self.overlays.push((layer, highlight).into());
|
||||
if !layer.is_empty() {
|
||||
self.overlays.push((layer, highlight).into());
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user