diff options
Diffstat (limited to 'src/tagline.zig')
| -rw-r--r-- | src/tagline.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tagline.zig b/src/tagline.zig index e847921e..b9abf5f0 100644 --- a/src/tagline.zig +++ b/src/tagline.zig @@ -81,7 +81,7 @@ pub fn revealHeader(p: *Pardes) void { v.header_top = 0; return; }; - const text = edit.flatSurface(p, t) catch unreachable; // a header's text is its own (flatSurface makes none) + const text = edit.flatSurface(p, t) catch |err| return p.reportError(v.active, "tag", err); const cur: usize = @intCast(@max(0, t.cur_row)); const rows: usize = if (p.headerColumn() != null) layout.columnBarHeight(p) else p.topBarHeight(); if (cur < v.header_top) v.header_top = cur; @@ -415,7 +415,7 @@ pub fn enterHeader(p: *Pardes, column: ?usize) void { p.view().header = if (column) |c| .{ .column = c } else .workspace; if (column) |c| p.setActiveColumn(c); const t = focusedHeader(p) orelse return exitHeader(p); - takeKeyboard(t, edit.flatSurface(p, t) catch unreachable); // a header's text is its own + takeKeyboard(t, edit.flatSurface(p, t) catch |err| return p.reportError(p.view().active, "tag", err)); } /// The span a header's selection covers on line `row` of its text, in @@ -443,7 +443,7 @@ pub fn workspaceBlank(p: *Pardes, col: u16, row: u16, tag_hit: ?pardes.TagHit) b const v = p.view(); if (row >= p.topBarHeight() or col >= v.screen_w) return false; if (col < TAG_TEXT_INSET) return true; - const text = edit.flatSurface(p, &p.global_tag) catch unreachable; // a header's text is its own + const text = edit.flatSurface(p, &p.global_tag) catch return false; const scroll: usize = if (v.header != null and p.headerColumn() == null) v.header_scroll else 0; const at = @as(usize, Layer.columnAt(p, .workspace, 0, tag_hit, false, 0) orelse (col - TAG_TEXT_INSET)) + scroll; return at >= panes.File.displayWidth(modal.lineSlice(text, 0)) + 2; |
