summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window-copy.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2014-04-24 09:14:44 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2014-04-24 09:14:44 +0000
commit3285ba15dcf88065741551f8381cfe8080104c07 (patch)
tree6cd6bf0626545a1069ba3e13ac32e8542fb4b042 /usr.bin/tmux/window-copy.c
parentf0ac760c1341a40ebb9fda45410b67b1a8e871db (diff)
There is no longer a need for a paste_stack struct or for global_buffers
to be global. Move to paste.c.
Diffstat (limited to 'usr.bin/tmux/window-copy.c')
-rw-r--r--usr.bin/tmux/window-copy.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index d82042b8a68..daa32b89529 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.106 2014/04/17 14:45:49 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.107 2014/04/24 09:14:43 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -776,7 +776,7 @@ window_copy_key_input(struct window_pane *wp, int key)
*data->inputstr = '\0';
break;
case MODEKEYEDIT_PASTE:
- if ((pb = paste_get_top(&global_buffers)) == NULL)
+ if ((pb = paste_get_top()) == NULL)
break;
for (n = 0; n < pb->size; n++) {
ch = (u_char) pb->data[n];
@@ -1465,8 +1465,8 @@ window_copy_copy_buffer(struct window_pane *wp, int idx, void *buf, size_t len)
if (idx == -1) {
limit = options_get_number(&global_options, "buffer-limit");
- paste_add(&global_buffers, buf, len, limit);
- } else if (paste_replace(&global_buffers, idx, buf, len) != 0)
+ paste_add(buf, len, limit);
+ } else if (paste_replace(idx, buf, len) != 0)
free(buf);
}
@@ -1524,13 +1524,13 @@ window_copy_append_selection(struct window_pane *wp, int idx)
if (idx == -1)
idx = 0;
- if (idx == 0 && paste_get_top(&global_buffers) == NULL) {
+ if (idx == 0 && paste_get_top() == NULL) {
limit = options_get_number(&global_options, "buffer-limit");
- paste_add(&global_buffers, buf, len, limit);
+ paste_add(buf, len, limit);
return;
}
- pb = paste_get_index(&global_buffers, idx);
+ pb = paste_get_index(idx);
if (pb != NULL) {
buf = xrealloc(buf, 1, len + pb->size);
memmove(buf + pb->size, buf, len);
@@ -1538,7 +1538,7 @@ window_copy_append_selection(struct window_pane *wp, int idx)
len += pb->size;
}
- if (paste_replace(&global_buffers, idx, buf, len) != 0)
+ if (paste_replace(idx, buf, len) != 0)
free(buf);
}