summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Ward <ian@excess.org>2014-01-01 18:41:06 -0500
committerIan Ward <ian@excess.org>2014-01-01 18:41:06 -0500
commit312b6afe2db88e54795c48c94411cd36dbdb19fc (patch)
tree70c7f32f051f338a9c36276e589ecec4512b5b15
parent05adf2448c8162638c75ee3b0b4a31ea2e38ca38 (diff)
downloadurwid-312b6afe2db88e54795c48c94411cd36dbdb19fc.tar.gz
fix raw_diplay: don't clear right when standout applied
-rw-r--r--urwid/raw_display.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/urwid/raw_display.py b/urwid/raw_display.py
index 7b66b7e..ec9364d 100644
--- a/urwid/raw_display.py
+++ b/urwid/raw_display.py
@@ -50,6 +50,7 @@ class Screen(BaseScreen, RealTerminal):
"""
super(Screen, self).__init__()
self._pal_escape = {}
+ self._pal_attrspec = {}
signals.connect_signal(self, UPDATE_PALETTE_ENTRY,
self._on_update_palette_entry)
self.colors = 16 # FIXME: detect this
@@ -81,8 +82,9 @@ class Screen(BaseScreen, RealTerminal):
def _on_update_palette_entry(self, name, *attrspecs):
# copy the attribute to a dictionary containing the escape seqences
- self._pal_escape[name] = self._attrspec_to_escape(
- attrspecs[{16:0,1:1,88:2,256:3}[self.colors]])
+ a = attrspecs[{16:0,1:1,88:2,256:3}[self.colors]]
+ self._pal_attrspec[name] = a
+ self._pal_escape[name] = self._attrspec_to_escape(a)
def set_input_timeouts(self, max_wait=None, complete_wait=0.125,
resize_wait=0.125):
@@ -686,12 +688,15 @@ class Screen(BaseScreen, RealTerminal):
cy = y
whitespace_at_end = False
- if row and row[-1][2][-1:] == B(' ') and self.back_color_erase:
- whitespace_at_end = True
+ if row:
a, cs, run = row[-1]
- row = row[:-1] + [(a, cs, run.rstrip(B(' ')))]
- elif y == maxrow-1 and maxcol>1:
- row, back, ins = self._last_row(row)
+ a = self._pal_attrspec.get(a, a)
+ if (run[-1:] == B(' ') and not a.standout and
+ self.back_color_erase):
+ whitespace_at_end = True
+ row = row[:-1] + [(a, cs, run.rstrip(B(' ')))]
+ elif y == maxrow-1 and maxcol > 1:
+ row, back, ins = self._last_row(row)
first = True
lasta = lastcs = None