mirror of
https://github.com/tmux/tmux.git
synced 2024-12-25 02:48:47 +00:00
Should add buffer if no -b.
This commit is contained in:
parent
216ddf3da5
commit
62bb6e37e0
@ -56,11 +56,13 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
|
|
||||||
bufname = args_get(args, 'b');
|
bufname = args_get(args, 'b');
|
||||||
if (bufname == NULL)
|
if (bufname == NULL)
|
||||||
pb = paste_get_top(&bufname);
|
pb = NULL;
|
||||||
else
|
else
|
||||||
pb = paste_get_name(bufname);
|
pb = paste_get_name(bufname);
|
||||||
|
|
||||||
if (self->entry == &cmd_delete_buffer_entry) {
|
if (self->entry == &cmd_delete_buffer_entry) {
|
||||||
|
if (pb == NULL)
|
||||||
|
pb = paste_get_top(&bufname);
|
||||||
if (pb == NULL) {
|
if (pb == NULL) {
|
||||||
cmdq_error(cmdq, "no buffer");
|
cmdq_error(cmdq, "no buffer");
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
@ -70,6 +72,8 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (args_has(args, 'n')) {
|
if (args_has(args, 'n')) {
|
||||||
|
if (pb == NULL)
|
||||||
|
pb = paste_get_top(&bufname);
|
||||||
if (pb == NULL) {
|
if (pb == NULL) {
|
||||||
cmdq_error(cmdq, "no buffer");
|
cmdq_error(cmdq, "no buffer");
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
|
Loading…
Reference in New Issue
Block a user