about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-09-07 22:13:09 -0400
committerJune McEnroe <june@causal.agency>2020-09-07 22:13:09 -0400
commit4ca49debb1abc2e7bbde75b92167d0823edbbb07 (patch)
treea2a70a46f3fb1b66b036ac58567a9f48597675fd
parentLet wrapped lines use the last column (diff)
downloadcatgirl-4ca49debb1abc2e7bbde75b92167d0823edbbb07.tar.gz
catgirl-4ca49debb1abc2e7bbde75b92167d0823edbbb07.zip
Call uiWrite to insert blank lines
It only used to use different code to avoid adding the blank line to the
soft buffer.
-rw-r--r--ui.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/ui.c b/ui.c
index 676f969..9499b23 100644
--- a/ui.c
+++ b/ui.c
@@ -815,16 +815,6 @@ static void showAuto(void) {
 	}
 }
 
-static void insertBlank(struct Window *window) {
-	int lines = bufferPush(window->buffer, COLS, false, Cold, time(NULL), "");
-	window->unreadHard += lines;
-	if (window->scroll) {
-		windowScroll(window, lines);
-	} else {
-		windowUpdate();
-	}
-}
-
 static void keyCode(int code) {
 	struct Window *window = windows.ptrs[windows.show];
 	uint id = window->id;
@@ -847,7 +837,7 @@ static void keyCode(int code) {
 		break; case KeyMetaD: edit(id, EditDeleteNextWord, 0);
 		break; case KeyMetaF: edit(id, EditNextWord, 0);
 		break; case KeyMetaL: bufferList(window->buffer);
-		break; case KeyMetaM: insertBlank(window);
+		break; case KeyMetaM: uiWrite(id, Cold, NULL, "");
 		break; case KeyMetaN: windowScrollHot(window, +1);
 		break; case KeyMetaP: windowScrollHot(window, -1);
 		break; case KeyMetaQ: edit(id, EditCollapse, 0);