mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
paste_send_pane can be merged into cmd-paste-buffer.c now.
This commit is contained in:
29
paste.c
29
paste.c
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user