Commits

Ian Ward  committed efad71f Draft

fix for Columns.move_cursor_to_coords not handling left/right

  • Participants
  • Parent commits aa6048e
  • Branches stable-1.1

Comments (0)

Files changed (1)

File urwid/container.py

         for i, (width, (w, options)) in enumerate(zip(widths, self.contents)):
             end = x + width
             if w.selectable():
-                # FIXME: sometimes, col == 'left' - that doesn't seem like its handled here, does it?
-                # assert isinstance(x, int) and isinstance(col, int), (x, col)
-                if x > col and best is None:
+                if (col == LEFT or x > col) and best is None:
                     # no other choice
                     best = i, x, end, w, options
                     break
-                if x > col and col-best[2] < x-col:
+                if col != RIGHT and x > col and col-best[2] < x-col:
                     # choose one on left
                     break
                 best = i, x, end, w, options
-                if col < end:
+                if col != RIGHT and col < end:
                     # choose this one
                     break
             x = end + self.dividechars