Commit 5bfca8a7 authored by mathieui's avatar mathieui

Fix highlights color

parent 20cb8f0b
...@@ -80,15 +80,18 @@ class Win: ...@@ -80,15 +80,18 @@ class Win:
@contextmanager @contextmanager
def colored_text(self, color: Optional[Tuple]=None, attr: Optional[int]=None): def colored_text(self, color: Optional[Tuple]=None, attr: Optional[int]=None):
"""Context manager which sets up an attr/color when inside""" """Context manager which sets up an attr/color when inside"""
if attr is None: if color is None and attr is None:
if color is not None: yield None
attr = to_curses_attr(color) return
else: if color is not None:
yield None mode = to_curses_attr(color)
return if attr is not None:
self._win.attron(attr) mode = mode | attr
else:
mode = attr
self._win.attron(mode)
yield None yield None
self._win.attroff(attr) self._win.attroff(mode)
def addstr(self, *args) -> None: def addstr(self, *args) -> None:
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment