summaryrefslogtreecommitdiffstats
path: root/notify.c
diff options
context:
space:
mode:
authornicm <nicm>2022-10-28 13:00:02 +0000
committernicm <nicm>2022-10-28 13:00:02 +0000
commit8edece2cdb7b4425526bae904506a246edbb6409 (patch)
treedeaaac60c890b8fd4e26913c21fcbfcf54c07508 /notify.c
parentc2580cfe2466589c8bd9348225820888a3fc4c0a (diff)
Add paste-buffer-deleted notification and fix name of paste-buffer-changed.
Diffstat (limited to 'notify.c')
-rw-r--r--notify.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/notify.c b/notify.c
index 03730b98..138fbeb1 100644
--- a/notify.c
+++ b/notify.c
@@ -153,6 +153,8 @@ notify_callback(struct cmdq_item *item, void *data)
control_notify_session_window_changed(ne->session);
if (strcmp(ne->name, "paste-buffer-changed") == 0)
control_notify_paste_buffer_changed(ne->pbname);
+ if (strcmp(ne->name, "paste-buffer-deleted") == 0)
+ control_notify_paste_buffer_deleted(ne->pbname);
notify_insert_hook(item, ne);
@@ -307,10 +309,16 @@ notify_pane(const char *name, struct window_pane *wp)
}
void
-notify_paste_buffer(const char *pbname)
+notify_paste_buffer(const char *pbname, int deleted)
{
struct cmd_find_state fs;
cmd_find_clear_state(&fs, 0);
- notify_add("paste-buffer-changed", &fs, NULL, NULL, NULL, NULL, pbname);
+ if (deleted) {
+ notify_add("paste-buffer-deleted", &fs, NULL, NULL, NULL, NULL,
+ pbname);
+ } else {
+ notify_add("paste-buffer-changed", &fs, NULL, NULL, NULL, NULL,
+ pbname);
+ }
}