mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-12 02:42:56 +02:00
Fix continuation char marking when rewrapping historybuf
This commit is contained in:
@@ -305,13 +305,6 @@ historybuf_pop_line(HistoryBuf *self, Line *line) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
history_buf_set_last_char_as_continuation(HistoryBuf *self, index_type y, bool wrapped) {
|
||||
if (self->count > 0) {
|
||||
cpu_lineptr(self, index_of(self, y))[self->xnum-1].next_char_was_wrapped = wrapped;
|
||||
}
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
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"
|
||||
@@ -608,9 +601,16 @@ HistoryBuf *alloc_historybuf(unsigned int lines, unsigned int columns, unsigned
|
||||
}
|
||||
// }}}
|
||||
|
||||
static void
|
||||
history_buf_set_last_char_as_continuation(HistoryBuf *self, index_type y, bool wrapped) {
|
||||
if (self->count > 0) {
|
||||
cpu_lineptr(self, index_of(self, y))[self->xnum-1].next_char_was_wrapped = wrapped;
|
||||
}
|
||||
}
|
||||
|
||||
index_type
|
||||
historybuf_next_dest_line(HistoryBuf *self, ANSIBuf *as_ansi_buf, Line *src_line, index_type dest_y, Line *dest_line, bool continued) {
|
||||
history_buf_set_last_char_as_continuation(self, dest_y, continued);
|
||||
history_buf_set_last_char_as_continuation(self, 0, continued);
|
||||
index_type idx = historybuf_push(self, as_ansi_buf);
|
||||
*attrptr(self, idx) = src_line->attrs;
|
||||
init_line(self, idx, dest_line);
|
||||
|
||||
@@ -546,6 +546,12 @@ last_char_has_wrapped_flag(Line* self, PyObject *a UNUSED) {
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
set_wrapped_flag(Line* self, PyObject *is_wrapped) {
|
||||
self->cpu_cells[self->xnum-1].next_char_was_wrapped = PyObject_IsTrue(is_wrapped);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
__repr__(Line* self) {
|
||||
PyObject *s = line_as_unicode(self, false);
|
||||
@@ -1028,6 +1034,7 @@ static PyMethodDef methods[] = {
|
||||
METHOD(set_attribute, METH_VARARGS)
|
||||
METHOD(as_ansi, METH_NOARGS)
|
||||
METHOD(last_char_has_wrapped_flag, METH_NOARGS)
|
||||
METHODB(set_wrapped_flag, METH_O),
|
||||
METHOD(hyperlink_ids, METH_NOARGS)
|
||||
METHOD(width, METH_O)
|
||||
METHOD(url_start_at, METH_O)
|
||||
|
||||
Reference in New Issue
Block a user