mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-08 01:04:06 +01:00
Buffers should be numbered from zero, from Tiago Cunha. Also fix paste -b.
This commit is contained in:
parent
8810fc158c
commit
51ca51e329
@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-list-buffers.c,v 1.4 2008-09-26 06:45:25 nicm Exp $ */
|
||||
/* $Id: cmd-list-buffers.c,v 1.5 2009-01-07 19:52:36 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -79,7 +79,7 @@ cmd_list_buffers_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
}
|
||||
|
||||
ctx->print(ctx, "%d: "
|
||||
"%zu bytes: \"%s\"", idx, strlen(pb->data), tmp);
|
||||
"%zu bytes: \"%s\"", idx - 1, strlen(pb->data), tmp);
|
||||
} else
|
||||
ctx->print(ctx, "%d: %zu bytes", idx, strlen(pb->data));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-paste-buffer.c,v 1.11 2008-06-20 18:58:13 nicm Exp $ */
|
||||
/* $Id: cmd-paste-buffer.c,v 1.12 2009-01-07 19:52:36 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -55,7 +55,7 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
if (data->buffer == -1)
|
||||
pb = paste_get_top(&s->buffers);
|
||||
else {
|
||||
if ((pb = paste_get_top(&s->buffers)) == NULL)
|
||||
if ((pb = paste_get_index(&s->buffers, data->buffer)) == NULL)
|
||||
ctx->error(ctx, "no buffer %d", data->buffer);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user