If we have pointers somewhere into the scrollback-buffer, there is not
easy way to see which of two lines comes first. Therefore, we introduce
scrollback buffer IDs. These are unique and every line gets one assigned
when it is linked into the sb-buffer. These IDs guarantee that front lines
have lower IDs than bottom lines.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
unsigned int size;
struct cell *cells;
+ uint64_t sb_id;
};
struct tsm_screen {
struct line *sb_last; /* last line; was moved last*/
unsigned int sb_max; /* max-limit of lines in sb */
struct line *sb_pos; /* current position in sb or NULL */
+ uint64_t sb_last_id; /* last id given to sb-line */
/* cursor */
unsigned int cursor_x;
line_free(tmp);
}
+ line->sb_id = ++con->sb_last_id;
line->next = NULL;
line->prev = con->sb_last;
if (con->sb_last)