aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2010-08-29 12:27:59 +0200
committerAurélien Aptel <aurelien.aptel@gmail.com>2010-08-29 12:27:59 +0200
commitc186c8ef9a995616384c425c5568b6913676b252 (patch)
tree48872a6517bfc15570348969a5c7d69e9210d3bc
parent6db6980e27bdde6f2d444dd3cdd7a46985fa84fc (diff)
downloadst-c186c8ef9a995616384c425c5568b6913676b252.tar.gz
st-c186c8ef9a995616384c425c5568b6913676b252.zip
merged tscroll() with tscrollup().
-rw-r--r--st.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/st.c b/st.c
index 9ca032f..eabc0c5 100644
--- a/st.c
+++ b/st.c
@@ -149,7 +149,6 @@ static void tputc(char);
149static void tputs(char*, int); 149static void tputs(char*, int);
150static void treset(void); 150static void treset(void);
151static void tresize(int, int); 151static void tresize(int, int);
152static void tscroll(void);
153static void tscrollup(int); 152static void tscrollup(int);
154static void tscrolldown(int); 153static void tscrolldown(int);
155static void tsetattr(int*, int); 154static void tsetattr(int*, int);
@@ -355,18 +354,6 @@ tnew(int col, int row) {
355 term.line[row] = calloc(term.col, sizeof(Glyph)); 354 term.line[row] = calloc(term.col, sizeof(Glyph));
356} 355}
357 356
358/* TODO: Replace with scrollup/scolldown */
359void
360tscroll(void) {
361 Line temp = term.line[term.top];
362 int i;
363
364 for(i = term.top; i < term.bot; i++)
365 term.line[i] = term.line[i+1];
366 memset(temp, 0, sizeof(Glyph) * term.col);
367 term.line[term.bot] = temp;
368}
369
370void 357void
371tscrolldown (int n) { 358tscrolldown (int n) {
372 int i; 359 int i;
@@ -404,7 +391,7 @@ void
404tnewline(void) { 391tnewline(void) {
405 int y = term.c.y + 1; 392 int y = term.c.y + 1;
406 if(y > term.bot) 393 if(y > term.bot)
407 tscroll(), y = term.bot; 394 tscrollup(1), y = term.bot;
408 tmoveto(0, y); 395 tmoveto(0, y);
409} 396}
410 397