commit 2e541a5

uint  ·  2026-08-02 17:48:24 +0000 UTC
parent 638e36c
use reset_rune in term_clear
2 files changed,  +3, -19
+1, -3
 1@@ -321,10 +321,8 @@ static void run(void)
 2 				continue;
 3 			}
 4 
 5-			if (handle_key(&ev)) {
 6+			if (handle_key(&ev))
 7 				dirty = true;
 8-				redraw_all = true;
 9-			}
10 		}
11 
12 		if (!running)
+2, -16
 1@@ -449,15 +449,8 @@ static void sgr(Term* t)
 2 void term_clear(Term* t, Caret* c)
 3 {
 4 	for (int y = 0; y < t->rows; y++) {
 5-		for (int x = 0; x < t->cols; x++) {
 6-			Rune* rune = &RUNE(t, x, y);
 7-			rune->cp = ' ';
 8-			rune->fg = t->fg;
 9-			rune->bg = t->bg;
10-			rune->attr = t->attr;
11-			rune->width = 1;
12-			rune->dmg = true;
13-		}
14+		for (int x = 0; x < t->cols; x++)
15+			reset_rune(t, x, y);
16 	}
17 
18 	c->x = 0;
19@@ -738,13 +731,6 @@ bool term_write(Term* t, Caret* c, const char* s, size_t n)
20 			damaged = true;
21 	}
22 
23-	for (int y = 0; y < t->rows; y++) {
24-		for (int x = 0; x < t->cols; x++) {
25-			if (RUNE(t, x, y).dmg)
26-				return true;
27-		}
28-	}
29-
30 	return damaged;
31 }
32