diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-05-07 13:02:27 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-05-07 13:02:27 +0100 |
commit | d9767b81123cc8913c63c42cc754cccbf34ccb6c (patch) | |
tree | 94e0a8cdb822db6145080c02907ad626c0d0fa89 /input.c | |
parent | eac30a86d78879f2dec802b0d246eba0afa79b3e (diff) | |
parent | 85a9c2f52b8855560fa9fdaa033d1c7bca738429 (diff) | |
download | rtmux-d9767b81123cc8913c63c42cc754cccbf34ccb6c.tar.gz rtmux-d9767b81123cc8913c63c42cc754cccbf34ccb6c.tar.bz2 rtmux-d9767b81123cc8913c63c42cc754cccbf34ccb6c.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -874,18 +874,27 @@ input_set_state(struct window_pane *wp, const struct input_transition *itr) void input_parse(struct window_pane *wp) { + struct evbuffer *evb = wp->event->input; + + input_parse_buffer(wp, EVBUFFER_DATA(evb), EVBUFFER_LENGTH(evb)); + evbuffer_drain(evb, EVBUFFER_LENGTH(evb)); +} + +/* Parse given input. */ +void +input_parse_buffer(struct window_pane *wp, u_char *buf, size_t len) +{ struct input_ctx *ictx = wp->ictx; struct screen_write_ctx *sctx = &ictx->ctx; const struct input_transition *itr; - struct evbuffer *evb = wp->event->input; - u_char *buf; - size_t len, off; + size_t off = 0; - if (EVBUFFER_LENGTH(evb) == 0) + if (len == 0) return; window_update_activity(wp->window); wp->flags |= PANE_CHANGED; + notify_input(wp, buf, len); /* * Open the screen. Use NULL wp if there is a mode set as don't want to @@ -897,12 +906,6 @@ input_parse(struct window_pane *wp) screen_write_start(sctx, NULL, &wp->base); ictx->wp = wp; - buf = EVBUFFER_DATA(evb); - len = EVBUFFER_LENGTH(evb); - off = 0; - - notify_input(wp, evb); - log_debug("%s: %%%u %s, %zu bytes: %.*s", __func__, wp->id, ictx->state->name, len, (int)len, buf); @@ -950,8 +953,6 @@ input_parse(struct window_pane *wp) /* Close the screen. */ screen_write_stop(sctx); - - evbuffer_drain(evb, len); } /* Split the parameter list (if any). */ |