From 71640aefb269a7c1ebc1ef8ec6a86f3ab09f0e7a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Nov 2016 11:12:20 +0530 Subject: [PATCH] Cursor.reset_display_attrs() --- kitty/cursor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kitty/cursor.c b/kitty/cursor.c index 2a85171d5..88219e512 100644 --- a/kitty/cursor.c +++ b/kitty/cursor.c @@ -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* copy(Cursor *self, PyObject *args); #define copy_doc "Create a clone of this cursor" @@ -92,6 +100,7 @@ static PyGetSetDef getseters[] = { static PyMethodDef methods[] = { METHOD(copy, METH_NOARGS) + METHOD(reset_display_attrs, METH_NOARGS) {NULL} /* Sentinel */ };