From 62bb6e37e0bdc2de2a20f7adc38993d2ccfd8c11 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 14 Sep 2015 12:52:22 +0000 Subject: [PATCH 1/2] Should add buffer if no -b. --- cmd-set-buffer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd-set-buffer.c b/cmd-set-buffer.c index 01afa774..e7f7627e 100644 --- a/cmd-set-buffer.c +++ b/cmd-set-buffer.c @@ -56,11 +56,13 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq) bufname = args_get(args, 'b'); if (bufname == NULL) - pb = paste_get_top(&bufname); + pb = NULL; else pb = paste_get_name(bufname); if (self->entry == &cmd_delete_buffer_entry) { + if (pb == NULL) + pb = paste_get_top(&bufname); if (pb == NULL) { cmdq_error(cmdq, "no buffer"); 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 (pb == NULL) + pb = paste_get_top(&bufname); if (pb == NULL) { cmdq_error(cmdq, "no buffer"); return (CMD_RETURN_ERROR); From 16ee4de5df3c31e362ed095e3feae1b504ddf1c5 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 14 Sep 2015 13:22:02 +0000 Subject: [PATCH 2/2] Remove some extra blank lines. --- cmd-find.c | 1 - cmd-set-option.c | 1 - paste.c | 1 - screen-write.c | 1 - window-clock.c | 1 - 5 files changed, 5 deletions(-) diff --git a/cmd-find.c b/cmd-find.c index 87dacfb4..ec883cbd 100644 --- a/cmd-find.c +++ b/cmd-find.c @@ -562,7 +562,6 @@ cmd_find_get_window_with_session(struct cmd_find_state *fs, const char *window) return (0); } - /* Stop now if exact only. */ if (exact) return (-1); diff --git a/cmd-set-option.c b/cmd-set-option.c index 98ab2513..e0b07edb 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -263,7 +263,6 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char *optstr, return (CMD_RETURN_NORMAL); } - /* Unset an option. */ int cmd_set_option_unset(struct cmd *self, struct cmd_q *cmdq, diff --git a/paste.c b/paste.c index fa58f7c1..44f88d0b 100644 --- a/paste.c +++ b/paste.c @@ -254,7 +254,6 @@ paste_set(char *data, size_t size, const char *name, char **cause) return (-1); } - pb = xmalloc(sizeof *pb); pb->name = xstrdup(name); diff --git a/screen-write.c b/screen-write.c index 37e2b548..f80048b6 100644 --- a/screen-write.c +++ b/screen-write.c @@ -46,7 +46,6 @@ screen_write_stop(unused struct screen_write_ctx *ctx) { } - /* Reset screen state. */ void screen_write_reset(struct screen_write_ctx *ctx) diff --git a/window-clock.c b/window-clock.c index 4a497891..5bc546a9 100644 --- a/window-clock.c +++ b/window-clock.c @@ -233,7 +233,6 @@ window_clock_draw_screen(struct window_pane *wp) screen_write_puts(&ctx, &gc, "%s", tim); } - screen_write_stop(&ctx); return; }