From 055631876121f9e5850a7423640c626b5461d128 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Wed, 20 Mar 2013 23:02:58 +0100 Subject: [PATCH] reflow: change _text_save_top() termpty_text_save_top() also change prototype --- src/bin/termptyops.c | 10 ++++------ src/bin/termptyops.h | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c index 140767f6..92ee44d9 100644 --- a/src/bin/termptyops.c +++ b/src/bin/termptyops.c @@ -28,17 +28,15 @@ _text_clear(Termpty *ty, Termcell *cells, int count, int val, Eina_Bool inherit_ termpty_cell_fill(ty, &src, cells, count); } -static void -_text_save_top(Termpty *ty) +void +termpty_text_save_top(Termpty *ty, Termcell *cells, ssize_t w_max) { Termsave *ts; - Termcell *cells; ssize_t w; if (ty->backmax <= 0) return; - cells = &(TERMPTY_SCREEN(ty, 0, 0)); - w = termpty_line_length(cells, ty->w); + w = termpty_line_length(cells, w_max); ts = calloc(1, sizeof(Termsave) + ((w - 1) * sizeof(Termcell))); ts->w = w; _termpty_text_copy(ty, cells, ts->cell, w); @@ -77,7 +75,7 @@ _termpty_text_scroll(Termpty *ty) { if (!ty->altbuf) { - _text_save_top(ty); + termpty_text_save_top(ty, &(TERMPTY_SCREEN(ty, 0, 0)), ty->w); if (ty->cb.scroll.func) ty->cb.scroll.func(ty->cb.scroll.data); } else diff --git a/src/bin/termptyops.h b/src/bin/termptyops.h index bf93c6b8..3358602c 100644 --- a/src/bin/termptyops.h +++ b/src/bin/termptyops.h @@ -5,6 +5,7 @@ typedef enum _Termpty_Clear TERMPTY_CLR_ALL } Termpty_Clear; +void termpty_text_save_top(Termpty *ty, Termcell *cells, ssize_t w_max); void _termpty_text_copy(Termpty *ty, Termcell *cells, Termcell *dest, int count); void _termpty_text_scroll(Termpty *ty); void _termpty_text_scroll_rev(Termpty *ty);