diff --git a/tmux.h b/tmux.h index aad11ffe..77285a8d 100644 --- a/tmux.h +++ b/tmux.h @@ -515,10 +515,11 @@ struct msg_stderr_data { #define ALL_MOUSE_MODES (MODE_MOUSE_STANDARD|MODE_MOUSE_BUTTON|MODE_MOUSE_ALL) /* - * A single UTF-8 character. UTF8_SIZE must be big enough to hold at least one - * combining character as well. + * A single UTF-8 character. UTF8_SIZE must be big enough to hold + * combining characters as well, currently at most five (of three + * bytes) are supported. */ -#define UTF8_SIZE 9 +#define UTF8_SIZE 18 struct utf8_data { u_char data[UTF8_SIZE]; diff --git a/window-copy.c b/window-copy.c index d865287a..c2d9b9ad 100644 --- a/window-copy.c +++ b/window-copy.c @@ -201,22 +201,10 @@ window_copy_init(struct window_pane *wp, __unused struct cmd_find_state *fs, struct window_copy_mode_data *data; struct screen *s; - wp->modedata = data = xmalloc(sizeof *data); - - data->oy = 0; - data->cx = 0; - data->cy = 0; + wp->modedata = data = xcalloc(1, sizeof *data); data->cursordrag = CURSORDRAG_NONE; - - data->lastcx = 0; - data->lastsx = 0; - - data->backing_written = 0; - data->lineflag = LINE_SEL_NONE; - data->rectflag = 0; - data->scroll_exit = 0; if (wp->searchstr != NULL) { data->searchtype = WINDOW_COPY_SEARCHUP;