Add linebuf_add_line_to_top()

This commit is contained in:
Eddie Lebow 2021-03-11 02:01:56 -05:00
parent 6c44b4f451
commit c93c87e8fe
No known key found for this signature in database
GPG Key ID: 21A09CFD989FD546
2 changed files with 8 additions and 0 deletions

View File

@ -396,6 +396,13 @@ delete_lines(LineBuf *self, PyObject *args) {
Py_RETURN_NONE; Py_RETURN_NONE;
} }
void
linebuf_add_line_to_top(LineBuf *self, Line *line) {
init_line(self, self->line, self->line_map[0]);
copy_line(line, self->line);
self->line_attrs[0] = TEXT_DIRTY_MASK | (line->continued ? CONTINUED_MASK : 0);
}
static PyObject* static PyObject*
as_ansi(LineBuf *self, PyObject *callback) { as_ansi(LineBuf *self, PyObject *callback) {
#define as_ansi_doc "as_ansi(callback) -> The contents of this buffer as ANSI escaped text. callback is called with each successive line." #define as_ansi_doc "as_ansi(callback) -> The contents of this buffer as ANSI escaped text. callback is called with each successive line."

View File

@ -93,6 +93,7 @@ void linebuf_reverse_index(LineBuf *self, index_type top, index_type bottom);
void linebuf_clear_line(LineBuf *self, index_type y); void linebuf_clear_line(LineBuf *self, index_type y);
void linebuf_insert_lines(LineBuf *self, unsigned int num, unsigned int y, unsigned int bottom); void linebuf_insert_lines(LineBuf *self, unsigned int num, unsigned int y, unsigned int bottom);
void linebuf_delete_lines(LineBuf *self, index_type num, index_type y, index_type bottom); void linebuf_delete_lines(LineBuf *self, index_type num, index_type y, index_type bottom);
void linebuf_add_line_to_top(LineBuf *, Line *);
void linebuf_set_attribute(LineBuf *, unsigned int , unsigned int ); void linebuf_set_attribute(LineBuf *, unsigned int , unsigned int );
void linebuf_rewrap(LineBuf *self, LineBuf *other, index_type *, index_type *, HistoryBuf *, index_type *, index_type *, ANSIBuf*); void linebuf_rewrap(LineBuf *self, LineBuf *other, index_type *, index_type *, HistoryBuf *, index_type *, index_type *, ANSIBuf*);
void linebuf_mark_line_dirty(LineBuf *self, index_type y); void linebuf_mark_line_dirty(LineBuf *self, index_type y);