'Set the current item to the closest item to self.fuzzyval.
Args:
offset: negative to get the next smaller item, positive for the
next bigger one.
Return:
True if the value snapped in (changed),
False when the value already was in the list.'

def _snap_in(self, offset):

    op = (operator.le if (offset < 0) else operator.ge)
    items = [(idx, e) for (idx, e) in enumerate(self._items) if op(e, self.fuzzyval)]
    if items:
        item = min(items, key=(lambda tpl: abs((self.fuzzyval - tpl[1]))))
    else:
        sorted_items = sorted([(idx, e) for (idx, e) in enumerate(self.items)], key=(lambda e: e[1]))
        idx = (0 if (offset < 0) else (-1))
        item = sorted_items[idx]
    self._idx = item[0]
    return (self.fuzzyval not in self._items)
