about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-03 14:52:16 -0500
committerJune McEnroe <june@causal.agency>2021-02-03 14:52:16 -0500
commit7807848bda7a0522f20fa942b1c46fd55ad2beba (patch)
treed87688b44d989b447de5c8810e77dbc6cc3e4272
parentchat.tmux.conf: Improve respawn, fix comment (diff)
downloadcatgirl-7807848bda7a0522f20fa942b1c46fd55ad2beba.tar.gz
catgirl-7807848bda7a0522f20fa942b1c46fd55ad2beba.zip
Add C-z C-v for literal next
A little annoying to make it a "chord" like this, but C-v is already
used for scrolling, following Emacs-style key bindings (in order
to have a way to scroll without using "special" keys like the arrows
and page up/down), and C-z is at least already in the business of
inserting control characters. This makes it possible to manually
enter some things that are otherwise only possible with /exec printf.
-rw-r--r--catgirl.16
-rw-r--r--ui.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/catgirl.1 b/catgirl.1
index d572a8b..03b708e 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -1,4 +1,4 @@
-.Dd January 26, 2021
+.Dd February  3, 2021
 .Dt CATGIRL 1
 .Os
 .
@@ -658,7 +658,9 @@ Scroll up a page.
 .El
 .
 .Ss IRC Formatting
-.Bl -tag -width Ds -compact
+.Bl -tag -width "C-z C-v" -compact
+.It Ic C-z C-v
+Insert the next input character literally.
 .It Ic C-z b
 Toggle bold.
 .It Ic C-z c
diff --git a/ui.c b/ui.c
index e75e0eb..557d0dc 100644
--- a/ui.c
+++ b/ui.c
@@ -1003,19 +1003,22 @@ void uiRead(void) {
 	}
 
 	wint_t ch;
-	static bool paste, style;
+	static bool paste, style, literal;
 	for (int ret; ERR != (ret = wget_wch(input, &ch));) {
 		if (ret == KEY_CODE_YES && ch == KeyPasteOn) {
 			paste = true;
 		} else if (ret == KEY_CODE_YES && ch == KeyPasteOff) {
 			paste = false;
-		} else if (paste) {
+		} else if (paste || literal) {
 			edit(windows.ptrs[windows.show]->id, EditInsert, ch);
 		} else if (ret == KEY_CODE_YES) {
 			keyCode(ch);
 		} else if (ch == (L'Z' ^ L'@')) {
 			style = true;
 			continue;
+		} else if (style && ch == (L'V' ^ L'@')) {
+			literal = true;
+			continue;
 		} else if (style) {
 			keyStyle(ch);
 		} else if (iswcntrl(ch)) {
@@ -1024,6 +1027,7 @@ void uiRead(void) {
 			edit(windows.ptrs[windows.show]->id, EditInsert, ch);
 		}
 		style = false;
+		literal = false;
 	}
 	inputUpdate();
 }
ks as largely uncritical of their characters. They behave in nonsense ways, are mostly uncritical of their own behaviour, and don't really have arcs of growth or change. I suppose this book had a bit of one, but only in the last two chapters. 2022-07-30Add Normal PeopleJune McEnroe Unbearably straight. Eyerolls and sighs per page off the charts. Shout out to Joanna, I guess. I kinda like the lack of quotation marks though to be honest. After half of the Ruth Ozeki novel and now this, I need to get back to some genre fiction. 2022-07-26Rewrite glitch from new pngoJune McEnroe 2022-07-26Update Care with time-to-ID and piercingsJune McEnroe 2022-07-26Add -w to upJune McEnroe 2022-07-13Set push.autoSetupRemoteJune McEnroe 2022-07-08Remove TOURJune McEnroe There is not that much distinct stuff here anymore. 2022-07-03Add The Bone Shard EmperorJune McEnroe Suffers a little bit from middle book but I really enjoyed it. Read it faster than the first one too, despite its length. 2022-06-25Bump xterm font size to 12June McEnroe 2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe Mixed bag like most collections of short stories. Some of them are pretty good. The author of the worst written story also has the worst written bio. 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe Absolutely indiscriminately. 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe