mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
input_stop_utf8 can move the cursor, so it is now wrong to store the
cursor position before calling it. Problem found by Jayakrishna Vadayath.
This commit is contained in:
8
input.c
8
input.c
@ -1234,7 +1234,7 @@ input_c0_dispatch(struct input_ctx *ictx)
|
||||
struct window_pane *wp = ictx->wp;
|
||||
struct screen *s = sctx->s;
|
||||
struct grid_cell gc, first_gc;
|
||||
u_int cx = s->cx, line = s->cy + s->grid->hsize;
|
||||
u_int cx, line;
|
||||
u_int width;
|
||||
int has_content = 0;
|
||||
|
||||
@ -1254,11 +1254,13 @@ input_c0_dispatch(struct input_ctx *ictx)
|
||||
break;
|
||||
case '\011': /* HT */
|
||||
/* Don't tab beyond the end of the line. */
|
||||
if (s->cx >= screen_size_x(s) - 1)
|
||||
cx = s->cx;
|
||||
if (cx >= screen_size_x(s) - 1)
|
||||
break;
|
||||
|
||||
/* Find the next tab point, or use the last column if none. */
|
||||
grid_get_cell(s->grid, s->cx, line, &first_gc);
|
||||
line = s->cy + s->grid->hsize;
|
||||
grid_get_cell(s->grid, cx, line, &first_gc);
|
||||
do {
|
||||
if (!has_content) {
|
||||
grid_get_cell(s->grid, cx, line, &gc);
|
||||
|
Reference in New Issue
Block a user