Add historybuf_pop_line()
This commit is contained in:
parent
b76491ba82
commit
6c44b4f451
@ -252,6 +252,19 @@ historybuf_add_line(HistoryBuf *self, const Line *line, ANSIBuf *as_ansi_buf) {
|
|||||||
*attrptr(self, idx) = (line->continued & CONTINUED_MASK) | (line->has_dirty_text ? TEXT_DIRTY_MASK : 0);
|
*attrptr(self, idx) = (line->continued & CONTINUED_MASK) | (line->has_dirty_text ? TEXT_DIRTY_MASK : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
historybuf_pop_line(HistoryBuf *self, Line *line) {
|
||||||
|
if (self->count <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
index_type idx = (self->start_of_data + self->count-1) % self->ynum;
|
||||||
|
init_line(self, idx, line);
|
||||||
|
|
||||||
|
self->count--;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
line(HistoryBuf *self, PyObject *val) {
|
line(HistoryBuf *self, PyObject *val) {
|
||||||
#define line_doc "Return the line with line number val. This buffer grows upwards, i.e. 0 is the most recently added line"
|
#define line_doc "Return the line with line number val. This buffer grows upwards, i.e. 0 is the most recently added line"
|
||||||
|
|||||||
@ -101,6 +101,7 @@ void linebuf_mark_line_as_not_continued(LineBuf *self, index_type y);
|
|||||||
unsigned int linebuf_char_width_at(LineBuf *self, index_type x, index_type y);
|
unsigned int linebuf_char_width_at(LineBuf *self, index_type x, index_type y);
|
||||||
void linebuf_refresh_sprite_positions(LineBuf *self);
|
void linebuf_refresh_sprite_positions(LineBuf *self);
|
||||||
void historybuf_add_line(HistoryBuf *self, const Line *line, ANSIBuf*);
|
void historybuf_add_line(HistoryBuf *self, const Line *line, ANSIBuf*);
|
||||||
|
bool historybuf_pop_line(HistoryBuf *, Line *);
|
||||||
void historybuf_rewrap(HistoryBuf *self, HistoryBuf *other, ANSIBuf*);
|
void historybuf_rewrap(HistoryBuf *self, HistoryBuf *other, ANSIBuf*);
|
||||||
void historybuf_init_line(HistoryBuf *self, index_type num, Line *l);
|
void historybuf_init_line(HistoryBuf *self, index_type num, Line *l);
|
||||||
CPUCell* historybuf_cpu_cells(HistoryBuf *self, index_type num);
|
CPUCell* historybuf_cpu_cells(HistoryBuf *self, index_type num);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user