summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorCurtis McEnroe2018-08-09 00:24:49 -0400
committerCurtis McEnroe2018-08-09 00:24:49 -0400
commita64f1a4ea2962e534673e27d85d92703c64201b0 (patch)
tree1bcf8ffdf2ae7280b406fe021619e9c61b83de6b /ui.c
parentc024147504a4a1b3a6b1e40f5120bc57248f0531 (diff)
Add URL detection, listing and opening
Might also add /copy, like /open.
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ui.c b/ui.c
index be7fc15..9778473 100644
--- a/ui.c
+++ b/ui.c
@@ -99,8 +99,9 @@ static struct {
 	WINDOW *topic;
 	WINDOW *log;
 	WINDOW *input;
-	int scroll;
+	bool hide;
 	bool mark;
+	int scroll;
 } ui;
 
 void uiInit(void) {
@@ -135,8 +136,13 @@ static void uiResize(void) {
 }
 
 void uiHide(void) {
-	focusDisable();
+	ui.hide = true;
 	endwin();
+}
+
+void uiExit(void) {
+	uiHide();
+	focusDisable();
 	printf(
 		"This program is AGPLv3 free software!\n"
 		"The source is available at <" SOURCE_URL ">.\n"
@@ -144,6 +150,7 @@ void uiHide(void) {
 }
 
 void uiDraw(void) {
+	if (ui.hide) return;
 	pnoutrefresh(
 		ui.topic,
 		0, 0,
@@ -359,6 +366,8 @@ static bool keyCode(wint_t ch) {
 }
 
 void uiRead(void) {
+	ui.hide = false;
+
 	bool update = false;
 	int ret;
 	wint_t ch;