diff options
Diffstat (limited to 'src/draw.zig')
| -rw-r--r-- | src/draw.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/draw.zig b/src/draw.zig index 963d61c1..fb770b60 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -987,9 +987,11 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r // The grid's row: the gap cell and the text, as far as the pane. joinCells(s, region.rect.x, region.rect.y + @as(u16, @intCast(line)), storage[line * pitch ..][0..pitch], config.GUTTER, region.rect.w, tag_fg); } - if (temporary.cursor) |cursor| if (cursor.x - TAG_TEXT_INSET < r.w - TAG_TEXT_INSET) { - s.cursor = .{ .x = r.x + cursor.x, .y = region.rect.y + cursor.y, .bar = cursor.bar }; - }; + // Past a full row's end the layer's caret is at the tag's edge, as + // acme's tick is; the grid has no cell there, so it takes the last one. + if (temporary.cursor) |cursor| { + s.cursor = .{ .x = r.x + @min(cursor.x, r.w - 1), .y = region.rect.y + cursor.y, .bar = cursor.bar }; + } } /// A notice chip, painted once as a tag layer at the tagline's pitch, and the |
