aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2020-01-27 16:50:43 +0100
committerMarc André Tanner <mat@brain-dump.org>2020-01-27 17:11:07 +0100
commitb325f7e7acbf805baf43a86f3e3c2285bf573ba5 (patch)
tree8410ccc2d3e4494c6b06637d7f6eb47d7e89b4a5 /main.c
parent978f3d70b9047608789e40a0b67e91d4fd19e60a (diff)
downloadvis-b325f7e7acbf805baf43a86f3e3c2285bf573ba5.tar.gz
vis-b325f7e7acbf805baf43a86f3e3c2285bf573ba5.tar.xz
vis: make r<Enter> insert a new line
Special case <C-v><Enter> to still insert a carriage return as discussed in #656 and changed in 2cfc9c867bdfd4cc3ae3246f31cf636633fe1a5f. Due to limitations of the current implementation <C-v> is not generic, i.e. combining it as r<C-v><Enter> will not work. Fixes #765
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.c b/main.c
index ddf7c4b..bea18e7 100644
--- a/main.c
+++ b/main.c
@@ -2096,6 +2096,8 @@ static const char *insert_verbatim(Vis *vis, const char *keys, const Arg *arg) {
return NULL;
if ((rune = vis_keys_codepoint(vis, keys)) != (Rune)-1) {
len = runetochar(buf, &rune);
+ if (buf[0] == '\n')
+ buf[0] = '\r';
data = buf;
} else {
vis_info_show(vis, "Unknown key");