summaryrefslogtreecommitdiffstats
path: root/cmd-set-buffer.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 03:34:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 03:34:56 +0000
commit671f456761fc66649260e831ceee36ec3d4ba9ca (patch)
tree033c56bded071f681e1304311ba0bff449d477cc /cmd-set-buffer.c
parentAdding debian version 3.3a-5. (diff)
downloadtmux-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.c16
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);
}