From acd3a7a9325f8cb080f3dfdc9a1f0bf3d1e60996 Mon Sep 17 00:00:00 2001 From: Ian Ward Date: Sun, 27 Jan 2013 15:13:19 -0500 Subject: [PATCH] fix for Columns.move_cursor_to_coords not handling left/right --HG-- branch : stable-1.1 extra : transplant_source : %02v%D5S%7FX%E2d%C4%AC%15%8B%E1%BCd%B33%5B%00_ --- urwid/container.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/urwid/container.py b/urwid/container.py index dfb3f5586..2bed039bd 100755 --- a/urwid/container.py +++ b/urwid/container.py @@ -2104,17 +2104,15 @@ def move_cursor_to_coords(self, size, col, row): 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