summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorC. McEnroe2020-02-09 14:09:27 -0500
committerC. McEnroe2020-02-09 14:09:27 -0500
commit5254e1035c5945407ee354276f839426fc17e432 (patch)
tree3dcbba594340dd4f5fd72bac0cced834fd9db1b9 /ui.c
parentf0e2c089c943abc2d298646e9fd988aa2a1c0c16 (diff)
Add /help
Now with automatic search! Also had to fix the SIGCHLD handling...
Diffstat (limited to 'ui.c')
-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;