From 22fa37b7230067b0c79d6ab06658e16e5b3515ed Mon Sep 17 00:00:00 2001 From: Tobias Predel Date: Fri, 19 Jan 2024 19:03:44 +0100 Subject: [PATCH] Wrap as you type on multiple cell selection --- src/document.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/document.h b/src/document.h index 893e453e..cac6dfe7 100755 --- a/src/document.h +++ b/src/document.h @@ -972,10 +972,13 @@ struct Document { } else if (uk >= ' ') { if (!selected.g) return NoSel(); Cell *c = selected.ThinExpand(this); - if (!c) return OneCell(); + if (!c) { + selected.Wrap(this); + c = selected.GetCell(); + } + c->AddUndo(this); // FIXME: not needed for all keystrokes, or at least, merge all + // keystroke undos within same cell ShiftToCenter(dc); - c->AddUndo(this); // FIXME: not needed for all keystrokes, or at least, merge all - // keystroke undos within same cell c->text.Key(this, uk, selected); ScrollIfSelectionOutOfView(dc, selected, true); return nullptr;