From c0ec60c11314fe34808641578b1ca73cf6c15066 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 23 Mar 2021 09:56:58 +0530 Subject: [PATCH] Forgot to change a couple of usages of line_as_unicode --- kitty/history.c | 2 +- kitty/line.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kitty/history.c b/kitty/history.c index 3a4ae5baf..bba7bb863 100644 --- a/kitty/history.c +++ b/kitty/history.c @@ -278,7 +278,7 @@ __str__(HistoryBuf *self) { if (lines == NULL) return PyErr_NoMemory(); for (index_type i = 0; i < self->count; i++) { init_line(self, index_of(self, i), self->line); - PyObject *t = line_as_unicode(self->line); + PyObject *t = line_as_unicode(self->line, false); if (t == NULL) { Py_CLEAR(lines); return NULL; } PyTuple_SET_ITEM(lines, i, t); } diff --git a/kitty/line.c b/kitty/line.c index 82cd3eabe..9dc8b3305 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -388,6 +388,12 @@ __repr__(Line* self) { return ans; } +static PyObject* +__str__(Line* self) { + return line_as_unicode(self, false); +} + + static PyObject* width(Line *self, PyObject *val) { #define width_doc "width(x) -> the width of the character at x" @@ -907,7 +913,7 @@ PyTypeObject Line_Type = { .tp_basicsize = sizeof(Line), .tp_dealloc = (destructor)dealloc, .tp_repr = (reprfunc)__repr__, - .tp_str = (reprfunc)line_as_unicode, + .tp_str = (reprfunc)__str__, .tp_as_sequence = &sequence_methods, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_richcompare = richcmp,