Pass in the session, rather than the client, to window modes' key()

function. We were only ever using the client to find the session anyway.

This allows send-key to work properly for manipulating copy mode from
outside tmux.

From Micah Cowan.
This commit is contained in:
Nicholas Marriott
2010-05-23 19:42:19 +00:00
parent 0ed727a012
commit 4f5c5b37b8
8 changed files with 33 additions and 34 deletions

View File

@ -721,7 +721,7 @@ window_pane_reset_mode(struct window_pane *wp)
}
void
window_pane_key(struct window_pane *wp, struct client *c, int key)
window_pane_key(struct window_pane *wp, struct session *sess, int key)
{
struct window_pane *wp2;
@ -730,7 +730,7 @@ window_pane_key(struct window_pane *wp, struct client *c, int key)
if (wp->mode != NULL) {
if (wp->mode->key != NULL)
wp->mode->key(wp, c, key);
wp->mode->key(wp, sess, key);
return;
}
@ -749,7 +749,7 @@ window_pane_key(struct window_pane *wp, struct client *c, int key)
void
window_pane_mouse(
struct window_pane *wp, struct client *c, struct mouse_event *m)
struct window_pane *wp, struct session *sess, struct mouse_event *m)
{
if (!window_pane_visible(wp))
return;
@ -763,7 +763,7 @@ window_pane_mouse(
if (wp->mode != NULL) {
if (wp->mode->mouse != NULL)
wp->mode->mouse(wp, c, m);
wp->mode->mouse(wp, sess, m);
} else if (wp->fd != -1)
input_mouse(wp, m);
}