diff options
author | June McEnroe <june@causal.agency> | 2021-02-15 19:07:56 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-02-15 19:15:38 -0500 |
commit | 4b26ae23cd24cc59d6d387a4e2d9cea7a8812318 (patch) | |
tree | 6647cbc6e637d5255cba820e9233d4197734bfb9 /ui.c | |
parent | Refactor Focus and Paste mode strings (diff) | |
download | catgirl-4b26ae23cd24cc59d6d387a4e2d9cea7a8812318.tar.gz catgirl-4b26ae23cd24cc59d6d387a4e2d9cea7a8812318.zip |
Add C-z p to manually toggle paste mode
OpenBSD's xterm doesn't have bracketed paste mode, and it would be nice to still be able to paste in several lines and collapse them with M-q, provided one remembers to type C-z p first...
Diffstat (limited to 'ui.c')
-rw-r--r-- | ui.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui.c b/ui.c index f1d784a..3c6c4ed 100644 --- a/ui.c +++ b/ui.c @@ -211,7 +211,8 @@ static short colorPair(short fg, short bg) { X(KeyFocusIn, "\33[I", NULL) \ X(KeyFocusOut, "\33[O", NULL) \ X(KeyPasteOn, "\33[200~", NULL) \ - X(KeyPasteOff, "\33[201~", NULL) + X(KeyPasteOff, "\33[201~", NULL) \ + X(KeyPasteManual, "\32p", "\32\20") enum { KeyMax = KEY_MAX, @@ -1007,6 +1008,8 @@ void uiRead(void) { paste = true; } else if (ret == KEY_CODE_YES && ch == KeyPasteOff) { paste = false; + } else if (ret == KEY_CODE_YES && ch == KeyPasteManual) { + paste ^= true; } else if (paste || literal) { edit(windows.ptrs[windows.show]->id, EditInsert, ch); } else if (ret == KEY_CODE_YES) { |