solve #36 by adding :fill command
Some checks failed
Test Rust project / test (ubuntu-latest, stable) (push) Failing after 53s

This commit is contained in:
2026-01-28 16:29:16 -07:00
parent 9691268d3d
commit 045d1d6554
3 changed files with 20 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ impl Widget for &App {
for x in 0..x_max {
for y in 0..y_max {
let mut display = String::new();
let mut style = Style::new().fg(Color::White);
let mut style = Style::new();
// Custom width for the header of each row
let row_header_width = get_header_size() as u16;
@@ -148,6 +148,9 @@ impl Widget for &App {
Ok(val) => {
display = val.to_string();
style = Style::new()
.fg(Color::White)
// TODO This breaks dumb terminals like the windows
// terminal
.underline_color(Color::DarkGray)
.add_modifier(Modifier::UNDERLINED);
}

View File

@@ -175,6 +175,21 @@ impl Mode {
};
match args[0] {
"f" | "fill" => {
for (i, x) in (low_x..=hi_x).enumerate() {
for (j, y) in (low_y..=hi_y).enumerate() {
let arg = args.get(1)
.map(|s| s.replace("xi", &i.to_string()))
.map(|s| s.replace("yi", &j.to_string()))
.map(|s| s.replace("x", &x.to_string()))
.map(|s| s.replace("y", &y.to_string()))
;
app.grid.set_cell_raw((x,y), arg);
}
}
app.mode = Mode::Normal
}
"export" => {
if let Some(arg1) = args.get(1) {
save_range(&arg1);