From 90c426b8544d17ef1d462efa4dc92c7ca8ddcc99 Mon Sep 17 00:00:00 2001 From: Rushmore75 Date: Thu, 13 Nov 2025 17:49:58 -0700 Subject: [PATCH] final touches on row/column insertion --- README.md | 4 ++++ src/app/mode.rs | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5899a98..cf3b405 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ if value.can_be_a_number() { | `r` | Enter insert mode on current cell, deleting contents | | `v` | Enter visual mode | | `:` | Enter command mode | +| `O` | Insert row above cursor | +| `o` | Insert row below cursor | +| `A` | Insert column after cursor | +| `I` | Insert column before cursor | | `yy` | Yank current cell | | `d `/`dw` | Cut current cell | | `p` | Paste clipboard (cursor is top-left of multi-cell pastes). Automatically translates cell references | diff --git a/src/app/mode.rs b/src/app/mode.rs index b8f63fe..a07ddb4 100644 --- a/src/app/mode.rs +++ b/src/app/mode.rs @@ -166,11 +166,15 @@ impl Mode { } // insert column after 'A' => { - app.grid.insert_column_after(app.grid.cursor()); + let c = app.grid.cursor(); + app.grid.insert_column_after(c); + app.grid.mv_cursor_to(c.0+1, c.1); } // insert row below 'o' => { - app.grid.insert_row_below(app.grid.cursor()); + let c = app.grid.cursor(); + app.grid.insert_row_below(c); + app.grid.mv_cursor_to(c.0, c.1+1); } // insert row above 'O' => {