Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/ui/text.rs')
| -rw-r--r-- | helix-view/src/ui/text.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/helix-view/src/ui/text.rs b/helix-view/src/ui/text.rs index 224aa230..52082080 100644 --- a/helix-view/src/ui/text.rs +++ b/helix-view/src/ui/text.rs @@ -1,4 +1,4 @@ -use crate::compositor::{Component, RenderContext}; +use crate::compositor::{self, Component, RenderContext}; use crate::graphics::Rect; pub struct Text { @@ -27,7 +27,8 @@ impl From<tui::text::Text<'static>> for Text { } } -impl Component for Text { +#[cfg(feature = "term")] +impl compositor::term::Render for Text { fn render(&mut self, area: Rect, cx: &mut RenderContext<'_>) { use tui::widgets::{Paragraph, Widget, Wrap}; @@ -36,7 +37,9 @@ impl Component for Text { par.render(area, cx.surface); } +} +impl Component for Text { fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> { if viewport != self.viewport { let width = std::cmp::min(self.contents.width() as u16, viewport.0); |