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.
Diffstat (limited to '')
-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);
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