summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/ui.c b/ui.c
index 72ff0f4..9f198c4 100644
--- a/ui.c
+++ b/ui.c
@@ -131,6 +131,17 @@ static struct View *viewTag(struct Tag tag) {
 	return view;
 }
 
+void uiHide(void) {
+	ui.hide = true;
+	termMode(TERM_FOCUS, false);
+	endwin();
+}
+
+static void uiShow(void) {
+	ui.hide = false;
+	termMode(TERM_FOCUS, true);
+}
+
 void uiInit(void) {
 	setlocale(LC_CTYPE, "");
 	initscr();
@@ -138,7 +149,6 @@ void uiInit(void) {
 	noecho();
 
 	colorInit();
-	termMode(TERM_FOCUS, true);
 
 	ui.input = newpad(2, INPUT_COLS);
 	mvwhline(ui.input, 0, 0, ACS_HLINE, INPUT_COLS);
@@ -147,16 +157,12 @@ void uiInit(void) {
 	nodelay(ui.input, true);
 
 	ui.view = viewTag(TAG_STATUS);
-}
 
-void uiHide(void) {
-	ui.hide = true;
-	endwin();
+	uiShow();
 }
 
 void uiExit(void) {
 	uiHide();
-	termMode(TERM_FOCUS, false);
 	printf(
 		"This program is AGPLv3 free software!\n"
 		"The source is available at <" SOURCE_URL ">.\n"
@@ -461,7 +467,7 @@ static bool keyCode(wchar_t ch) {
 }
 
 void uiRead(void) {
-	ui.hide = false;
+	uiShow();
 
 	bool update = false;
 	int ret;
c/commit/bin/hi.c?id=ddaef3b27a7339faca4cdb982c022b38bf8d9606&follow=1'>Match sh functions as TagJune McEnroe 2019-02-18Match Sh and Ss as Tag in mdocJune McEnroe 2019-02-18Match statics and typedefs as TagJune McEnroe 2019-02-18Clean up htmlHeaderJune McEnroe 2019-02-18Remove hi line numberingJune McEnroe 2019-02-18Add Tag class to hiJune McEnroe 2019-02-17Generate HTML with hi -n -f html -o anchorJune McEnroe 2019-02-17Add hi -f html -o anchor for line number linksJune McEnroe 2019-02-17Simplify temp trap in upJune McEnroe 2019-02-17Add line numbers to hiJune McEnroe 2019-02-17Always split spans after newlinesJune McEnroe 2019-02-15Color format specifiers light cyan in vimJune McEnroe 2019-02-15Highlight Interp as yellowJune McEnroe 2019-02-15Highlight strings in sh command substitutionsJune McEnroe 2019-02-15Add nmap gpJune McEnroe 2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe 2019-02-13Add forgotten "sixth" book of H2G2June McEnroe