summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/paste.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-05-16 15:24:28 +0000
committernicm <nicm@openbsd.org>2020-05-16 15:24:28 +0000
commita6c9106f9d79b8887f0919341cd2b70b9b028b12 (patch)
tree40a31dcbe6c56130066619ff743c54434c45a511 /usr.bin/tmux/paste.c
parentUse formats for status-style and message-style. (diff)
downloadwireguard-openbsd-a6c9106f9d79b8887f0919341cd2b70b9b028b12.tar.xz
wireguard-openbsd-a6c9106f9d79b8887f0919341cd2b70b9b028b12.zip
Add 'e' key in buffer mode to open the buffer in an editor.
Diffstat (limited to 'usr.bin/tmux/paste.c')
-rw-r--r--usr.bin/tmux/paste.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/tmux/paste.c b/usr.bin/tmux/paste.c
index a6b925b05f0..48cab16721f 100644
--- a/usr.bin/tmux/paste.c
+++ b/usr.bin/tmux/paste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paste.c,v 1.40 2019/04/02 09:03:39 nicm Exp $ */
+/* $OpenBSD: paste.c,v 1.41 2020/05/16 15:24:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -297,6 +297,15 @@ paste_set(char *data, size_t size, const char *name, char **cause)
return (0);
}
+/* Set paste data without otherwise changing it. */
+void
+paste_replace(struct paste_buffer *pb, char *data, size_t size)
+{
+ free(pb->data);
+ pb->data = data;
+ pb->size = size;
+}
+
/* Convert start of buffer into a nice string. */
char *
paste_make_sample(struct paste_buffer *pb)