diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 03:34:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 03:34:56 +0000 |
commit | 671f456761fc66649260e831ceee36ec3d4ba9ca (patch) | |
tree | 033c56bded071f681e1304311ba0bff449d477cc /cmd-set-buffer.c | |
parent | Adding debian version 3.3a-5. (diff) | |
download | tmux-671f456761fc66649260e831ceee36ec3d4ba9ca.tar.xz tmux-671f456761fc66649260e831ceee36ec3d4ba9ca.zip |
Merging upstream version 3.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmd-set-buffer.c')
-rw-r--r-- | cmd-set-buffer.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cmd-set-buffer.c b/cmd-set-buffer.c index 9112683..35e7295 100644 --- a/cmd-set-buffer.c +++ b/cmd-set-buffer.c @@ -69,8 +69,13 @@ cmd_set_buffer_exec(struct cmd *self, struct cmdq_item *item) pb = paste_get_name(bufname); if (cmd_get_entry(self) == &cmd_delete_buffer_entry) { - if (pb == NULL) + if (pb == NULL) { + if (bufname != NULL) { + cmdq_error(item, "unknown buffer: %s", bufname); + return (CMD_RETURN_ERROR); + } pb = paste_get_top(&bufname); + } if (pb == NULL) { cmdq_error(item, "no buffer"); return (CMD_RETURN_ERROR); @@ -80,8 +85,13 @@ cmd_set_buffer_exec(struct cmd *self, struct cmdq_item *item) } if (args_has(args, 'n')) { - if (pb == NULL) + if (pb == NULL) { + if (bufname != NULL) { + cmdq_error(item, "unknown buffer: %s", bufname); + return (CMD_RETURN_ERROR); + } pb = paste_get_top(&bufname); + } if (pb == NULL) { cmdq_error(item, "no buffer"); return (CMD_RETURN_ERROR); @@ -121,7 +131,7 @@ cmd_set_buffer_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_ERROR); } if (args_has(args, 'w') && tc != NULL) - tty_set_selection(&tc->tty, bufdata, bufsize); + tty_set_selection(&tc->tty, "", bufdata, bufsize); return (CMD_RETURN_NORMAL); } |