From eca05f1fc0ec6fc9c207193ddcba9f00995f6fdc Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 30 Dec 2010 23:16:18 +0000 Subject: Change from a per-session stack of buffers to one global stack which is much more convenient and also simplifies lot of code. This renders copy-buffer useless and makes buffer-limit now a server option. By Tiago Cunha. --- usr.bin/tmux/cmd-paste-buffer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'usr.bin/tmux/cmd-paste-buffer.c') diff --git a/usr.bin/tmux/cmd-paste-buffer.c b/usr.bin/tmux/cmd-paste-buffer.c index 6d5ba756d06..ea06af65efa 100644 --- a/usr.bin/tmux/cmd-paste-buffer.c +++ b/usr.bin/tmux/cmd-paste-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-paste-buffer.c,v 1.14 2010/08/11 07:38:00 nicm Exp $ */ +/* $OpenBSD: cmd-paste-buffer.c,v 1.15 2010/12/30 23:16:18 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -136,9 +136,10 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) return (-1); if (data->buffer == -1) - pb = paste_get_top(&s->buffers); + pb = paste_get_top(&global_buffers); else { - if ((pb = paste_get_index(&s->buffers, data->buffer)) == NULL) { + pb = paste_get_index(&global_buffers, data->buffer); + if (pb == NULL) { ctx->error(ctx, "no buffer %d", data->buffer); return (-1); } @@ -150,9 +151,9 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) /* Delete the buffer if -d. */ if (data->flag_delete) { if (data->buffer == -1) - paste_free_top(&s->buffers); + paste_free_top(&global_buffers); else - paste_free_index(&s->buffers, data->buffer); + paste_free_index(&global_buffers, data->buffer); } return (0); -- cgit v1.2.3-59-g8ed1b