diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-08-29 09:36:47 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-08-29 09:36:47 +0000 |
commit | c2f746b0f3d2da784a5ecf4e885735c5df529f74 (patch) | |
tree | c6a31050cf4ee6eae187741289d76b88a18ae8a5 /usr.bin/tmux/paste.c | |
parent | 9d332c354ae9609d0c3cbcc30db4f3b4081c8039 (diff) |
paste_send_pane can be merged into cmd-paste-buffer.c now.
Diffstat (limited to 'usr.bin/tmux/paste.c')
-rw-r--r-- | usr.bin/tmux/paste.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/usr.bin/tmux/paste.c b/usr.bin/tmux/paste.c index 62e6b10eed6..ff16fe2a766 100644 --- a/usr.bin/tmux/paste.c +++ b/usr.bin/tmux/paste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: paste.c,v 1.28 2015/08/29 09:25:00 nicm Exp $ */ +/* $OpenBSD: paste.c,v 1.29 2015/08/29 09:36:46 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -319,32 +319,3 @@ paste_make_sample(struct paste_buffer *pb, int utf8flag) strlcpy(buf + width, "...", 4); return (buf); } - -/* Paste into a window pane, filtering '\n' according to separator. */ -void -paste_send_pane(struct paste_buffer *pb, struct window_pane *wp, - const char *sep, int bracket) -{ - const char *data = pb->data, *end = data + pb->size, *lf; - size_t seplen; - - if (wp->flags & PANE_INPUTOFF) - return; - - if (bracket && (wp->screen->mode & MODE_BRACKETPASTE)) - bufferevent_write(wp->event, "\033[200~", 6); - - seplen = strlen(sep); - while ((lf = memchr(data, '\n', end - data)) != NULL) { - if (lf != data) - bufferevent_write(wp->event, data, lf - data); - bufferevent_write(wp->event, sep, seplen); - data = lf + 1; - } - - if (end != data) - bufferevent_write(wp->event, data, end - data); - - if (bracket && (wp->screen->mode & MODE_BRACKETPASTE)) - bufferevent_write(wp->event, "\033[201~", 6); -} |