Forgot to change a couple of usages of line_as_unicode

This commit is contained in:
Kovid Goyal
2021-03-23 09:56:58 +05:30
parent ca7587c084
commit c0ec60c113
2 changed files with 8 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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,