From f5d7a80272ca2d091c5a511019ac4b8d98ca7167 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 5 Aug 2018 08:59:30 +0000 Subject: calloc the mode data instead of malloc and initialize everything. --- window-copy.c | 14 +------------- window.c | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) 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; diff --git a/window.c b/window.c index db6ff8c9..019718f2 100644 --- a/window.c +++ b/window.c @@ -894,7 +894,6 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv, char *argv0, *cmd, **argvp; const char *ptr, *first, *home; struct termios tio2; - int i; sigset_t set, oldset; if (wp->fd != -1) { -- cgit From a5ef1f2ed6f830aa25e4fcab9618c3ccea17d8db Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 9 Aug 2018 09:53:44 +0000 Subject: Bump the UTF-8 character array up to 18 to allow for more combining characters (some languages use up to five). This size doesn't make as much difference now that UTF-8 goes into an extended cell. GitHub issue 1430. --- tmux.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tmux.h b/tmux.h index 8c3a2364..a612fa46 100644 --- a/tmux.h +++ b/tmux.h @@ -511,10 +511,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]; -- cgit -- cgit