This commit is contained in:
2025-11-11 15:30:07 -07:00
parent 48186cd680
commit e92d6b309e
3 changed files with 44 additions and 18 deletions

View File

@@ -1,10 +1,10 @@
use std::{
cmp::{max, min},
cmp::min,
fmt::Display,
};
use ratatui::{
layout::Rect, prelude, style::{Color, Style}, widgets::{Paragraph, Widget}
prelude, style::{Color, Style}, widgets::{Paragraph, Widget}
};
use crate::app::{app::App, calc::LEN, error_msg::ErrorMessage};
@@ -152,11 +152,13 @@ impl Mode {
Mode::Chord(chord) => {
chord.add_char(key);
// the chord starts with a :, send it over to be a comman
if chord.buf[0] == ':' {
app.mode = Mode::Command(Chord::new(':'));
return;
}
// Try and parse out a preceding number
match chord.as_string()[0..chord.as_string().len() - 1].parse::<usize>() {
// For chords that can take a numeric input
Ok(num) => match key {
@@ -184,6 +186,11 @@ impl Mode {
app.grid.selected_cell.1 = 0;
app.mode = Mode::Normal;
}
"zz" => {
app.screen.center_x(app.grid.selected_cell, &app.vars);
app.screen.center_y(app.grid.selected_cell, &app.vars);
app.mode = Mode::Normal;
}
_ => {}
},
}