cell-sheet-tui 0.2.0

A terminal spreadsheet editor with Vim-like keybindings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use ratatui::{buffer::Buffer, layout::Rect, style::Style, widgets::Widget};

pub struct CommandLine<'a> {
    pub content: &'a str,
    pub prefix: char,
    pub active: bool,
}

impl<'a> Widget for CommandLine<'a> {
    fn render(self, area: Rect, buf: &mut Buffer) {
        if area.height == 0 || !self.active {
            return;
        }
        let display = format!("{}{}", self.prefix, self.content);
        buf.set_string(area.x, area.y, &display, Style::default());
    }
}