summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-15 18:59:17 -0500
committerJune McEnroe <june@causal.agency>2021-02-15 19:15:38 -0500
commit66c67542fff6d85c836a4e920e8f250820ad8967 (patch)
treebcd1059984373368d67b99fd8402fea65cd386a2 /ui.c
parentDon't insert wchar_t if it can't be converted to mbs (diff)
downloadcatgirl-66c67542fff6d85c836a4e920e8f250820ad8967.tar.gz
catgirl-66c67542fff6d85c836a4e920e8f250820ad8967.zip
Refactor Focus and Paste mode strings
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/ui.c b/ui.c
index 557d0dc..f1d784a 100644
--- a/ui.c
+++ b/ui.c
@@ -222,16 +222,14 @@ enum {
 
 // XXX: Assuming terminals will be fine with these even if they're unsupported,
 // since they're "private" modes.
-static const char *EnterFocusMode = "\33[?1004h";
-static const char *ExitFocusMode  = "\33[?1004l";
-static const char *EnterPasteMode = "\33[?2004h";
-static const char *ExitPasteMode  = "\33[?2004l";
+static const char *FocusMode[2] = { "\33[?1004l", "\33[?1004h" };
+static const char *PasteMode[2] = { "\33[?2004l", "\33[?2004h" };
 
 struct Time uiTime = { .format = "%X" };
 
 static void errExit(void) {
-	putp(ExitFocusMode);
-	putp(ExitPasteMode);
+	putp(FocusMode[false]);
+	putp(PasteMode[false]);
 	reset_shell_mode();
 }
 
@@ -447,8 +445,8 @@ static void unmark(struct Window *window) {
 void uiShow(void) {
 	if (!hidden) return;
 	prevTitle[0] = '\0';
-	putp(EnterFocusMode);
-	putp(EnterPasteMode);
+	putp(FocusMode[true]);
+	putp(PasteMode[true]);
 	fflush(stdout);
 	hidden = false;
 	unmark(windows.ptrs[windows.show]);
@@ -458,8 +456,8 @@ void uiHide(void) {
 	if (hidden) return;
 	mark(windows.ptrs[windows.show]);
 	hidden = true;
-	putp(ExitFocusMode);
-	putp(ExitPasteMode);
+	putp(FocusMode[false]);
+	putp(PasteMode[false]);
 	endwin();
 }