Cursor.reset_display_attrs()

This commit is contained in:
Kovid Goyal 2016-11-10 11:12:20 +05:30
parent 8f8e9baedc
commit 71640aefb2

View File

@ -56,6 +56,14 @@ repr(Cursor *self) {
); );
} }
static PyObject *
reset_display_attrs(Cursor *self) {
#define reset_display_attrs_doc "Reset all display attributes to unset"
self->bg = 0; self->fg = 0; self->decoration_fg = 0;
self->decoration = 0; self->bold = false; self->italic = false; self->reverse = false; self->strikethrough = false;
Py_RETURN_NONE;
}
static PyObject* static PyObject*
copy(Cursor *self, PyObject *args); copy(Cursor *self, PyObject *args);
#define copy_doc "Create a clone of this cursor" #define copy_doc "Create a clone of this cursor"
@ -92,6 +100,7 @@ static PyGetSetDef getseters[] = {
static PyMethodDef methods[] = { static PyMethodDef methods[] = {
METHOD(copy, METH_NOARGS) METHOD(copy, METH_NOARGS)
METHOD(reset_display_attrs, METH_NOARGS)
{NULL} /* Sentinel */ {NULL} /* Sentinel */
}; };