-/* $OpenBSD: mode-tree.c,v 1.59 2021/10/26 12:22:23 nicm Exp $ */
+/* $OpenBSD: mode-tree.c,v 1.60 2021/11/15 10:58:13 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
}
sy = screen_size_y(s);
- if (!mtd->preview || sy <= 4 || h <= 4 || sy - h <= 4 || w <= 4) {
- screen_write_stop(&ctx);
- return;
- }
+ if (!mtd->preview || sy <= 4 || h <= 4 || sy - h <= 4 || w <= 4)
+ goto done;
line = &mtd->line_list[mtd->current];
mti = line->item;
mtd->drawcb(mtd->modedata, mti->itemdata, &ctx, box_x, box_y);
}
+done:
+ screen_write_cursormove(&ctx, 0, mtd->current - mtd->offset, 0);
screen_write_stop(&ctx);
}
-/* $OpenBSD: server-client.c,v 1.389 2021/10/28 18:54:33 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.390 2021/11/15 10:58:13 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
struct window_pane *wp = server_client_get_pane(c), *loop;
struct screen *s = NULL;
struct options *oo = c->session->options;
- int mode = 0, cursor, flags;
+ int mode = 0, cursor, flags, n;
u_int cx = 0, cy = 0, ox, oy, sx, sy;
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
tty_margin_off(tty);
/* Move cursor to pane cursor and offset. */
- if (c->overlay_draw == NULL) {
+ if (c->prompt_string != NULL) {
+ n = options_get_number(c->session->options, "status-position");
+ if (n == 0)
+ cy = 0;
+ else {
+ n = status_line_size(c);
+ if (n == 0)
+ cy = tty->sy - 1;
+ else
+ cy = tty->sy - n;
+ }
+ cx = c->prompt_cursor;
+ mode &= ~MODE_CURSOR;
+ } else if (c->overlay_draw == NULL) {
cursor = 0;
tty_window_offset(tty, &ox, &oy, &sx, &sy);
if (wp->xoff + s->cx >= ox && wp->xoff + s->cx <= ox + sx &&
-/* $OpenBSD: status.c,v 1.230 2021/11/01 07:48:04 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.231 2021/11/15 10:58:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
offset = 0;
if (pwidth > left)
pwidth = left;
+ c->prompt_cursor = start + c->prompt_index - offset;
width = 0;
for (i = 0; c->prompt_buffer[i].size != 0; i++) {
-/* $OpenBSD: tmux.h,v 1.1154 2021/11/03 13:37:17 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1155 2021/11/15 10:58:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
#define PROMPT_KEY 0x10
int prompt_flags;
enum prompt_type prompt_type;
+ int prompt_cursor;
struct session *session;
struct session *last_session;