summaryrefslogtreecommitdiff
path: root/src/Terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 16:38:06 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commitbdbab17204efdb785b6ab3cc2022484485c0ded2 (patch)
tree34aa73b7bfbccd46b008e06cd116f35130a117b3 /src/Terminal.zig
parente87e16547a17864b2a0cd574c1aa42d44125bc6c (diff)
downloadpardes-bdbab17204efdb785b6ab3cc2022484485c0ded2.tar.gz
pardes-bdbab17204efdb785b6ab3cc2022484485c0ded2.zip
g. goes to where the last edit ended
helix goto_last_modification: every range moves to the end of the last change (the start of a deletion, the end of an insertion), extending in select mode. The position is kept on the Text in surface rows, set where setEditText hands a body its new text, so a terminal's typed text has one too and moves with its scrollback. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Terminal.zig')
-rw-r--r--src/Terminal.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Terminal.zig b/src/Terminal.zig
index 1ff561b1..4c29e151 100644
--- a/src/Terminal.zig
+++ b/src/Terminal.zig
@@ -720,7 +720,7 @@ pub fn feedOutput(p: *Pardes, pane: *Pane, bytes: []const u8) void {
if (comptime !enabled) return;
if (pane.terminal == null) return;
const has_positions = pane.ovl != null or pane.body.cur_pinned or pane.body.vsel.active or
- pane.body.msel.active or pane.body.nsel > 0 or pane.look_at != null or
+ pane.body.msel.active or pane.body.nsel > 0 or pane.body.last_edit != null or pane.look_at != null or
pane.body.ed_undo_len > 0 or pane.body.ed_redo_len > 0 or pointerRowCount(pane) > 0;
// Sticky bottom, as every other terminal does it: output drags the
// viewport down only when the viewport was already on the last row, so
@@ -846,6 +846,10 @@ fn ingestWithPositions(pane: *Pane, bytes: []const u8) void {
extra[nextra + 1] = &selection.arow;
nextra += 2;
}
+ if (pane.body.last_edit) |*at| {
+ extra[nextra] = &at.row;
+ nextra += 1;
+ }
if (pane.look_at) |*at| {
extra[nextra] = &at.row;
nextra += 1;