diff --git a/pym/calculate/lib/utils/colortext/output.py b/pym/calculate/lib/utils/colortext/output.py index 16ee7b4..64e8bc1 100644 --- a/pym/calculate/lib/utils/colortext/output.py +++ b/pym/calculate/lib/utils/colortext/output.py @@ -294,9 +294,15 @@ class ColorTerminalOutput(SaveAttrOutput): def handleColor(self, prevstate, curstate, attrs, tail_attrs): """Обработать изменение цветов (фон и/или тон)""" - if prevstate.foreground != curstate.foreground: + # if prevstate.foreground != curstate.foreground: + # self.handleForeground(prevstate, curstate, attrs, tail_attrs) + if prevstate.foreground != curstate.foreground or \ + curstate.foreground is not None and prevstate.foreground == curstate.foreground: self.handleForeground(prevstate, curstate, attrs, tail_attrs) - if prevstate.background != curstate.background: + # if prevstate.background != curstate.background: + # self.handleBackground(prevstate, curstate, attrs, tail_attrs) + if prevstate.background != curstate.background or \ + curstate.background is not None and prevstate.background == curstate.background: self.handleBackground(prevstate, curstate, attrs, tail_attrs) def _createAttrs(self, prevstate, curstate): @@ -320,9 +326,9 @@ class ColorTerminalOutput(SaveAttrOutput): self.handleUnderline(prevstate, curstate, attrs, tail_attrs) if prevstate.invert != curstate.invert: self.handleInvert(prevstate, curstate, attrs, tail_attrs) - if (prevstate.foreground != curstate.foreground or - prevstate.background != curstate.background): - self.handleColor(prevstate, curstate, attrs, tail_attrs) + # if (prevstate.foreground != curstate.foreground or + # prevstate.background != curstate.background): + self.handleColor(prevstate, curstate, attrs, tail_attrs) return attrs, tail_attrs def _createEscCode(self, attrs):