summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-09 14:09:27 -0500
committerJune McEnroe <june@causal.agency>2020-02-09 14:09:27 -0500
commit5254e1035c5945407ee354276f839426fc17e432 (patch)
tree3dcbba594340dd4f5fd72bac0cced834fd9db1b9 /ui.c
parentAdd M-u (diff)
downloadcatgirl-5254e1035c5945407ee354276f839426fc17e432.tar.gz
catgirl-5254e1035c5945407ee354276f839426fc17e432.zip
Add /help
Now with automatic search! Also had to fix the SIGCHLD handling...
Diffstat (limited to '')
-rw-r--r--ui.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui.c b/ui.c
index 9abfffc..66a9c59 100644
--- a/ui.c
+++ b/ui.c
@@ -156,13 +156,18 @@ static const char *ExitFocusMode  = "\33[?1004l";
 static const char *EnterPasteMode = "\33[?2004h";
 static const char *ExitPasteMode  = "\33[?2004l";
 
+static bool hidden;
+
 void uiShow(void) {
 	putp(EnterFocusMode);
 	putp(EnterPasteMode);
 	fflush(stdout);
+	hidden = false;
+	uiDraw();
 }
 
 void uiHide(void) {
+	hidden = true;
 	putp(ExitFocusMode);
 	putp(ExitPasteMode);
 	endwin();
@@ -250,6 +255,7 @@ void uiInit(void) {
 }
 
 void uiDraw(void) {
+	if (hidden) return;
 	wnoutrefresh(status);
 	struct Window *window = windows.active;
 	pnoutrefresh(
@@ -755,6 +761,7 @@ static void keyStyle(wchar_t ch) {
 }
 
 void uiRead(void) {
+	if (hidden) return;
 	int ret;
 	wint_t ch;
 	static bool style;