# HG changeset patch # User Teemu Piippo # Date 1437701417 -10800 # Node ID 71f1cd8154a9233bfc14f361b8f546852fcb2088 # Parent d301ead29d7c19d9ca7cf10d2dffd8f181252e9e Slight refactor on the fix in the previous commit diff -r d301ead29d7c -r 71f1cd8154a9 sources/interface.cpp --- a/sources/interface.cpp Fri Jul 24 04:24:38 2015 +0300 +++ b/sources/interface.cpp Fri Jul 24 04:30:17 2015 +0300 @@ -278,6 +278,11 @@ mvaddch (y, x, char (byte)); ++x; } + else if (byte >= RLINE_ON_COLOR and byte < RLINE_ON_BOLD) + { + auto attrfunction = (byte < RLINE_OFF_COLOR ? &attron : &attroff); + (*attrfunction) (color_pair (Color ((byte - RLINE_ON_COLOR) & 7), DEFAULT)); + } else switch (byte) { case RLINE_ON_BOLD: @@ -287,13 +292,6 @@ case RLINE_OFF_BOLD: attroff (A_BOLD); break; - - default: - if (byte < 256) - break; - - (byte < RLINE_OFF_COLOR ? attron : attroff) (color_pair (Color ((byte - RLINE_ON_COLOR) & 7), DEFAULT)); - break; } }