1use crate::compositor::{Component, Context};
2use tui::buffer::Buffer as Surface;
4use helix_view::graphics::Rect;
11 pub fn new(contents: String) -> Self {
15impl Component for Text {
16 fn render(&mut self, area: Rect, surface: &mut Surface, _cx: &mut Context) {
17 use tui::widgets::{Paragraph, Widget, Wrap};
18 let contents = tui::text::Text::from(self.contents.clone());
20 let par = Paragraph::new(contents).wrap(Wrap { trim: false });
21 // .scroll(x, y) offsets
23 par.render(area, surface);
26 fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> {
27 let contents = tui::text::Text::from(self.contents.clone());
28 let width = std::cmp::min(contents.width() as u16, viewport.0);
29 let height = std::cmp::min(contents.height() as u16, viewport.1);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list