def get_insert_pt(self, view):
        sel = view.sel()
        pt = sel[0].end()
        content = view.substr(view.line(pt))
        wrap_width = get_wrap_width(view)

        if len(content) <= wrap_width:
            return None

        if view.settings().get('auto_wrap_beyond_only', False):
            if view.rowcol(pt)[1] < wrap_width:
                return None

        default = [r"\[", r"\(", r"\{", " ", r"\n"]
        if view.score_selector(pt, "text.tex.latex"):
            default = [r"\\left\\.", r"\\left.", r"\\\{"] + default

        break_chars = "|".join(view.settings().get('auto_wrap_break_patterns', default))
        results = re.finditer(break_chars, content)
        indices = [m.start(0) for m in results] + [len(content)]
        index = next(x[0] for x in enumerate(indices) if x[1] > wrap_width)

        if view.settings().get("auto_wrap_break_long_word", True) and index > 0:
            return view.line(pt).begin() + indices[index-1]
        else:
            if index == len(indices)-1:
                return None
            return view.line(pt).begin() + indices[index]
dataset/ETHPy150Open randy3k/AutoWrap/autowrap.py/AutoWrapListener.get_insert_pt/original