Need to set clients in context before changing their reference count.

This commit is contained in:
Nicholas Marriott
2013-03-22 15:54:29 +00:00
parent d644e5143f
commit 2243cfbe75
8 changed files with 15 additions and 18 deletions

View File

@ -220,8 +220,7 @@ window_choose_data_run(struct window_choose_data *cdata)
return;
}
ctx = cmd_get_ctx();
ctx->curclient = cdata->start_client;
ctx = cmd_get_ctx(NULL, cdata->start_client);
ctx->error = key_bindings_error;
ctx->print = key_bindings_print;
ctx->info = key_bindings_info;
@ -492,7 +491,7 @@ window_choose_key(struct window_pane *wp, unused struct session *sess, int key)
items = ARRAY_LENGTH(&data->list);
if (data->input_type == WINDOW_CHOOSE_GOTO_ITEM) {
switch (mode_key_lookup(&data->mdata, key)) {
switch (mode_key_lookup(&data->mdata, key, NULL)) {
case MODEKEYCHOICE_CANCEL:
data->input_type = WINDOW_CHOOSE_NORMAL;
window_choose_redraw_screen(wp);
@ -523,7 +522,7 @@ window_choose_key(struct window_pane *wp, unused struct session *sess, int key)
return;
}
switch (mode_key_lookup(&data->mdata, key)) {
switch (mode_key_lookup(&data->mdata, key, NULL)) {
case MODEKEYCHOICE_CANCEL:
window_choose_fire_callback(wp, NULL);
break;
@ -777,7 +776,7 @@ window_choose_key_index(struct window_choose_mode_data *data, u_int idx)
int mkey;
for (ptr = keys; *ptr != '\0'; ptr++) {
mkey = mode_key_lookup(&data->mdata, *ptr);
mkey = mode_key_lookup(&data->mdata, *ptr, NULL);
if (mkey != MODEKEY_NONE && mkey != MODEKEY_OTHER)
continue;
if (idx-- == 0)
@ -797,7 +796,7 @@ window_choose_index_key(struct window_choose_mode_data *data, int key)
u_int idx = 0;
for (ptr = keys; *ptr != '\0'; ptr++) {
mkey = mode_key_lookup(&data->mdata, *ptr);
mkey = mode_key_lookup(&data->mdata, *ptr, NULL);
if (mkey != MODEKEY_NONE && mkey != MODEKEY_OTHER)
continue;
if (key == *ptr)