summaryrefslogtreecommitdiff
path: root/src/body_layer.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/body_layer.zig')
-rw-r--r--src/body_layer.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/body_layer.zig b/src/body_layer.zig
index ab8a888a..ff1f903c 100644
--- a/src/body_layer.zig
+++ b/src/body_layer.zig
@@ -661,8 +661,10 @@ pub fn paintHeaders(p: *Pardes) !void {
cell.style.bg = .{ .rgb = th.sel_bg };
}
}
+ // A prompt answering for the header has the caret on its band.
+ const asking = if (p.panes[p.active]) |active| active.prompt != .none else false;
const cur: usize = @intCast(@max(0, t.cur_row));
- if (cur >= p.header_top and cur < p.header_top + rows) {
+ if (!asking and cur >= p.header_top and cur < p.header_top + rows) {
const bar = modal.lineSlice(text, cur);
const caret = panes.File.rawDisplayCol(bar, @min(@as(usize, @intCast(@max(0, t.cur_col))), bar.len)) -| p.header_scroll;
if (caret < w) s.cursor = .{ .x = x + @as(u16, @intCast(caret)), .y = y + @as(u16, @intCast(cur - p.header_top)), .bar = t.mode == .insert };
@@ -861,7 +863,8 @@ fn renderHeaderLayer(p: *Pardes, arena: std.mem.Allocator, index: usize, kind: T
}
}
const caret = panes.File.rawDisplayCol(text, @min(@as(usize, @intCast(@max(0, t.cur_col))), text.len)) -| scroll;
- if (t.cur_row == line + p.header_top and caret < columns) layer.cursor = .{ .col = @intCast(caret), .bar = t.mode == .insert };
+ const asking = if (p.panes[p.active]) |active| active.prompt != .none else false;
+ if (!asking and t.cur_row == line + p.header_top and caret < columns) layer.cursor = .{ .col = @intCast(caret), .bar = t.mode == .insert };
} else if (p.pointer_inside) {
const tag_hit = p.pointer_tag_hit;
const col: ?usize = if (tag_hit) |pointer|
@@ -920,7 +923,7 @@ pub fn paintPaneTag(p: *Pardes, arena: std.mem.Allocator, pane: *Pane, r: Rect,
null
else if (pane.prompt == .name)
.{ .row = 0, .at = @min(lines[0].len, @as(usize, @intCast(@max(0, pane.input.cur_col)))) }
- else if (pane.focus == .tag and pane.tag.cur_row >= top and pane.tag.cur_row < top + rows) caret: {
+ else if (pane.focus == .tag and pane.prompt == .none and pane.tag.cur_row >= top and pane.tag.cur_row < top + rows) caret: {
const row: usize = @intCast(pane.tag.cur_row - top);
const lead: usize = if (row + top == 0) prefix_len else 0;
break :caret .{ .row = row, .at = @min(lines[row].len, lead + @as(usize, @intCast(@max(0, pane.tag.cur_col)))) };