diff options
| author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-08-29 12:27:59 +0200 |
|---|---|---|
| committer | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-08-29 12:27:59 +0200 |
| commit | c186c8ef9a995616384c425c5568b6913676b252 (patch) | |
| tree | 48872a6517bfc15570348969a5c7d69e9210d3bc | |
| parent | 6db6980e27bdde6f2d444dd3cdd7a46985fa84fc (diff) | |
| download | st-c186c8ef9a995616384c425c5568b6913676b252.tar.gz st-c186c8ef9a995616384c425c5568b6913676b252.zip | |
merged tscroll() with tscrollup().
| -rw-r--r-- | st.c | 15 |
1 files changed, 1 insertions, 14 deletions
| @@ -149,7 +149,6 @@ static void tputc(char); | |||
| 149 | static void tputs(char*, int); | 149 | static void tputs(char*, int); |
| 150 | static void treset(void); | 150 | static void treset(void); |
| 151 | static void tresize(int, int); | 151 | static void tresize(int, int); |
| 152 | static void tscroll(void); | ||
| 153 | static void tscrollup(int); | 152 | static void tscrollup(int); |
| 154 | static void tscrolldown(int); | 153 | static void tscrolldown(int); |
| 155 | static void tsetattr(int*, int); | 154 | static 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 */ | ||
| 359 | void | ||
| 360 | tscroll(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 | |||
| 370 | void | 357 | void |
| 371 | tscrolldown (int n) { | 358 | tscrolldown (int n) { |
| 372 | int i; | 359 | int i; |
| @@ -404,7 +391,7 @@ void | |||
| 404 | tnewline(void) { | 391 | tnewline(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 | ||
