Add copy-mode -c to initialize the preferred cursor column

This commit is contained in:
Michael Grant
2026-10-05 12:29:17 +01:00
parent 8f25579c5a
commit a1825146ee
5 changed files with 206 additions and 3 deletions

View File

@@ -614,6 +614,11 @@ window_copy_init(struct window_mode_entry *wme,
window_copy_sync_snapshot(data, base->grid);
data->cx = cx;
if (args_has(args, 'c')) {
/* Start with a preferred column rather than end of line. */
data->lastcx = cx;
data->lastsx = cx + 1;
}
if (cy < screen_hsize(data->backing)) {
data->cy = 0;
data->oy = screen_hsize(data->backing) - cy;