Surface respects cl by using single arrow keys within a single line

This commit is contained in:
Mitchell Hashimoto
2026-02-02 13:32:53 -08:00
parent 4a1f02043a
commit 7af49f6cc6

View File

@@ -4374,9 +4374,23 @@ fn maybePromptClick(self: *Surface) !bool {
} }, .locked);
},
.cl => |cl| {
// TODO: Handle these
_ = cl;
.cl => {
const left_arrow = if (t.modes.get(.cursor_keys)) "\x1bOD" else "\x1b[D";
const right_arrow = if (t.modes.get(.cursor_keys)) "\x1bOC" else "\x1b[C";
const move = screen.promptClickMove(click_pin);
for (0..move.left) |_| {
self.queueIo(
.{ .write_stable = left_arrow },
.locked,
);
}
for (0..move.right) |_| {
self.queueIo(
.{ .write_stable = right_arrow },
.locked,
);
}
},
}