Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code

This commit is contained in:
Nicholas Marriott 2013-02-20 10:59:02 +00:00
commit f81d723264
10 changed files with 13 additions and 16 deletions

2
cfg.c
View File

@ -92,7 +92,7 @@ load_cfg(const char *path, struct cmd_ctx *ctx, struct causelist *causes)
if (ctx != NULL) if (ctx != NULL)
cmd_ref_ctx(ctx); cmd_ref_ctx(ctx);
else { else {
ctx = cmd_get_ctx(); ctx = cmd_get_ctx(NULL, NULL);
ctx->error = cfg_error; ctx->error = cfg_error;
ctx->print = cfg_print; ctx->print = cfg_print;
ctx->info = cfg_print; ctx->info = cfg_print;

View File

@ -184,8 +184,7 @@ cmd_command_prompt_callback(void *data, const char *s)
return (0); return (0);
} }
ctx = cmd_get_ctx(); ctx = cmd_get_ctx(NULL, c);
ctx->curclient = c;
ctx->error = key_bindings_error; ctx->error = key_bindings_error;
ctx->print = key_bindings_print; ctx->print = key_bindings_print;
ctx->info = key_bindings_info; ctx->info = key_bindings_info;

View File

@ -125,8 +125,7 @@ cmd_confirm_before_callback(void *data, const char *s)
return (0); return (0);
} }
ctx = cmd_get_ctx(); ctx = cmd_get_ctx(NULL, c);
ctx->curclient = c;
ctx->error = key_bindings_error; ctx->error = key_bindings_error;
ctx->print = key_bindings_print; ctx->print = key_bindings_print;
ctx->info = key_bindings_info; ctx->info = key_bindings_info;

5
cmd.c
View File

@ -133,13 +133,16 @@ int cmd_find_index_offset(const char *, struct session *, int *);
struct window_pane *cmd_find_pane_offset(const char *, struct winlink *); struct window_pane *cmd_find_pane_offset(const char *, struct winlink *);
struct cmd_ctx * struct cmd_ctx *
cmd_get_ctx(void) cmd_get_ctx(struct client *cmdclient, struct client *curclient)
{ {
struct cmd_ctx *ctx; struct cmd_ctx *ctx;
ctx = xcalloc(1, sizeof *ctx); ctx = xcalloc(1, sizeof *ctx);
ctx->references = 0; ctx->references = 0;
ctx->cmdclient = cmdclient;
ctx->curclient = curclient;
cmd_ref_ctx(ctx); cmd_ref_ctx(ctx);
return (ctx); return (ctx);
} }

View File

@ -108,8 +108,7 @@ control_callback(struct client *c, int closed, unused void *data)
break; break;
} }
ctx = cmd_get_ctx(); ctx = cmd_get_ctx(NULL, c);
ctx->curclient = c;
ctx->error = control_msg_error; ctx->error = control_msg_error;
ctx->print = control_msg_print; ctx->print = control_msg_print;
ctx->info = control_msg_info; ctx->info = control_msg_info;

View File

@ -266,8 +266,7 @@ key_bindings_dispatch(struct key_binding *bd, struct client *c)
struct cmd *cmd; struct cmd *cmd;
int readonly; int readonly;
ctx = cmd_get_ctx(); ctx = cmd_get_ctx(NULL, c);
ctx->curclient = c;
ctx->error = key_bindings_error; ctx->error = key_bindings_error;
ctx->print = key_bindings_print; ctx->print = key_bindings_print;
ctx->info = key_bindings_info; ctx->info = key_bindings_info;

View File

@ -869,9 +869,8 @@ server_client_msg_command(struct client *c, struct msg_command_data *data)
int argc; int argc;
char **argv, *cause; char **argv, *cause;
ctx = cmd_get_ctx(); ctx = cmd_get_ctx(c, NULL);
ctx->msgdata = data; ctx->msgdata = data;
ctx->cmdclient = c;
ctx->error = server_client_msg_error; ctx->error = server_client_msg_error;
ctx->print = server_client_msg_print; ctx->print = server_client_msg_print;
ctx->info = server_client_msg_info; ctx->info = server_client_msg_info;

View File

@ -239,7 +239,7 @@ server_lock_client(struct client *c)
size_t cmdlen; size_t cmdlen;
struct msg_lock_data lockdata; struct msg_lock_data lockdata;
if (!(c->flags & CLIENT_CONTROL)) if (c->flags & CLIENT_CONTROL)
return; return;
if (c->flags & CLIENT_SUSPENDED) if (c->flags & CLIENT_SUSPENDED)

2
tmux.h
View File

@ -1714,7 +1714,7 @@ long long args_strtonum(
struct args *, u_char, long long, long long, char **); struct args *, u_char, long long, long long, char **);
/* cmd.c */ /* cmd.c */
struct cmd_ctx *cmd_get_ctx(void); struct cmd_ctx *cmd_get_ctx(struct client *, struct client *);
void cmd_free_ctx(struct cmd_ctx *); void cmd_free_ctx(struct cmd_ctx *);
void cmd_ref_ctx(struct cmd_ctx *); void cmd_ref_ctx(struct cmd_ctx *);
int cmd_pack_argv(int, char **, char *, size_t); int cmd_pack_argv(int, char **, char *, size_t);

View File

@ -220,8 +220,7 @@ window_choose_data_run(struct window_choose_data *cdata)
return; return;
} }
ctx = cmd_get_ctx(); ctx = cmd_get_ctx(NULL, cdata->start_client);
ctx->curclient = cdata->start_client;
ctx->error = key_bindings_error; ctx->error = key_bindings_error;
ctx->print = key_bindings_print; ctx->print = key_bindings_print;
ctx->info = key_bindings_info; ctx->info = key_bindings_info;