diff --git a/src/ui/app.rs b/src/ui/app.rs index c499809..d9b8888 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -506,7 +506,10 @@ mod tests { let mut app = two_col_model(); // Total rows: A, B, C + R0..R9 = 13 rows. Last row = 12. for i in 0..10 { - app.model.category_mut("Row").unwrap().add_item(&format!("R{i}")); + app.model + .category_mut("Row") + .unwrap() + .add_item(&format!("R{i}")); } app.term_height = 13; // ~5 visible rows app.model.active_view_mut().selected = (0, 0); diff --git a/src/ui/effect.rs b/src/ui/effect.rs index a4f26f3..f141291 100644 --- a/src/ui/effect.rs +++ b/src/ui/effect.rs @@ -96,7 +96,11 @@ impl Effect for RemoveFormula { pub struct EnterEditAtCursor; impl Effect for EnterEditAtCursor { fn apply(&self, app: &mut App) { - let ctx = app.cmd_context(crossterm::event::KeyCode::Null, crossterm::event::KeyModifiers::NONE); + app.rebuild_layout(); + let ctx = app.cmd_context( + crossterm::event::KeyCode::Null, + crossterm::event::KeyModifiers::NONE, + ); let value = ctx.display_value.clone(); drop(ctx); app.buffers.insert("edit".to_string(), value); @@ -472,9 +476,10 @@ pub struct SetDrillPendingEdit { impl Effect for SetDrillPendingEdit { fn apply(&self, app: &mut App) { if let Some(drill) = &mut app.drill_state { - drill - .pending_edits - .insert((self.record_idx, self.col_name.clone()), self.new_value.clone()); + drill.pending_edits.insert( + (self.record_idx, self.col_name.clone()), + self.new_value.clone(), + ); } } }