From 160693711d9df30564146fc826276c38d6ea2e18 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Mon, 31 Aug 2015 15:48:32 +0200 Subject: Reset the bold and underline attribute when absent, in addstr_colored --- src/windows/base_wins.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/windows') diff --git a/src/windows/base_wins.py b/src/windows/base_wins.py index 915242a9..464c6fa1 100644 --- a/src/windows/base_wins.py +++ b/src/windows/base_wins.py @@ -137,6 +137,10 @@ class Win(object): self._win.attron(curses.A_UNDERLINE) elif char == 'b': self._win.attron(curses.A_BOLD) + else: + # this will reset previous bold/uderline sequences if any was used + self._win.attroff(curses.A_UNDERLINE) + self._win.attroff(curses.A_BOLD) elif color_str: self._win.attron(to_curses_attr((int(color_str), -1))) text = text[next_attr_char+len(color_str)+2:] -- cgit v1.2.3