summaryrefslogtreecommitdiff
path: root/urwid/canvas.py
diff options
context:
space:
mode:
Diffstat (limited to 'urwid/canvas.py')
-rw-r--r--urwid/canvas.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/urwid/canvas.py b/urwid/canvas.py
index 207ee21..3c96bbe 100644
--- a/urwid/canvas.py
+++ b/urwid/canvas.py
@@ -930,8 +930,7 @@ def shard_body(cviews, shard_tail, create_iter=True, iter_default=None):
try:
cview = next(cviews_iter)
except StopIteration:
- raise CanvasError("cviews do not fill gaps in"
- " shard_tail!")
+ break
(trim_left, trim_top, cols, rows, attr_map, canv) = \
cview[:6]
col += cols
@@ -1229,7 +1228,8 @@ def apply_text_layout(text, attr, ls, maxcol):
aw.k = 0
aw.off = 0
o = []
- while aw.off < end_offs:
+ # the loop should run at least once, the '=' part ensures that
+ while aw.off <= end_offs:
if len(attr)<=aw.k:
# run out of attributes
o.append((None,end_offs-max(start_offs,aw.off)))
@@ -1313,7 +1313,3 @@ def apply_text_layout(text, attr, ls, maxcol):
c.append(linec)
return TextCanvas(t, a, c, maxcol=maxcol)
-
-
-
-