diff options
Diffstat (limited to 'src/file_pane.zig')
| -rw-r--r-- | src/file_pane.zig | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/file_pane.zig b/src/file_pane.zig index be3ff201..8fc0fa0d 100644 --- a/src/file_pane.zig +++ b/src/file_pane.zig @@ -14,10 +14,16 @@ const look = @import("look.zig"); const output_pane = @import("output_pane.zig"); const syntax = @import("syntax.zig"); const tracy = @import("tracy.zig"); +const term_pane = @import("term_pane.zig"); const dump = @import("dump.zig"); const SYNTAX_CONTEXT_AFTER_ROWS: usize = 2; -const undo_max = 256; +/// EDIT BOUNDARIES REMEMBERED PER FILE PANE. Every entry owns a gpa copy of +/// the WHOLE file, so this number multiplies heap, not just the pane: 256 of +/// them is not a bound a 384 KiB board could ever reach anyway. `pushHistory` +/// evicts and frees the oldest once full, so the smaller ring loses the +/// deepest undo steps and nothing else — no truncation, no dropped edit. +const undo_max = if (@import("pardes_config").platform == .p4) 16 else 256; /// Content and primary selection at one file edit boundary. Keeping only the /// primary avoids putting pardes.MAX_SELS ranges in every history entry. @@ -723,8 +729,8 @@ pub fn drawGutter(p: *Pardes, pane: *Pane, r: pardes.Rect, tx: u16, tw: u16, bod const s = &p.surface; const ch = p.chromeTheme(); const goff = pane.scroll(); - const gcur = pane.vt.screens.active.cursor; - const gcrow = if (pane.cur_pinned) pane.cur_row else @as(i32, @intCast(gcur.y)) + goff; + const gcur = term_pane.gridCursor(pane); + const gcrow = if (pane.cur_pinned) pane.cur_row else @as(i32, gcur.y) + goff; // the cursor's LINE, not its row: wrapped, one line owns a run of rows and // the number sits on the first of them, so the whole run lights up — the // gutter is naming the line you are on, and that is still one line |
