def check_selection(self, view):
        sel = view.sel()
        if len(sel) == 0 or len(sel) > 1 or not sel[0].empty():
            self.reset_status()
            return False

        pt = sel[0].end()
        rc = view.rowcol(pt)
        if rc[0] != self.cursor[0]:
            self.reset_status()

        if rc[0] != self.cursor[0] or rc[1] <= self.cursor[1] or rc[1] > self.cursor[1]+1:
            self.cursor = view.rowcol(sel[0].end())
            return False
        else:
            self.cursor = view.rowcol(sel[0].end())
            return True
dataset/ETHPy150Open randy3k/AutoWrap/autowrap.py/AutoWrapListener.check_selection/original