Add linebuf_continued_lines_count()

This commit is contained in:
Eddie Lebow 2021-03-14 01:49:15 -05:00
parent c93c87e8fe
commit 4682da83c1
No known key found for this signature in database
GPG Key ID: 21A09CFD989FD546
2 changed files with 10 additions and 0 deletions

View File

@ -326,6 +326,15 @@ is_continued(LineBuf *self, PyObject *val) {
Py_RETURN_FALSE;
}
unsigned int
linebuf_continued_lines_count(LineBuf *self, index_type stop_at_line) {
unsigned int count = 0;
for (unsigned int i = 0; i < self->ynum && i < stop_at_line; i++)
if (self->line_attrs[i] & CONTINUED_MASK) count++;
return count;
}
void
linebuf_insert_lines(LineBuf *self, unsigned int num, unsigned int y, unsigned int bottom) {
index_type i;

View File

@ -91,6 +91,7 @@ void linebuf_clear(LineBuf *, char_type ch);
void linebuf_index(LineBuf* self, index_type top, index_type bottom);
void linebuf_reverse_index(LineBuf *self, index_type top, index_type bottom);
void linebuf_clear_line(LineBuf *self, index_type y);
unsigned int linebuf_continued_lines_count(LineBuf *, index_type);
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_add_line_to_top(LineBuf *, Line *);