def on_modified(self, view):
        if view.settings().get('is_widget'):
            return
        if not view.settings().get('auto_wrap', False):
            return

        if not self.check_selection(view):
            return

        insertpt = self.get_insert_pt(view)
        if not insertpt:
            return

        self.set_status()

        join = self.status >= 2
        left_delete = " " not in view.substr(sublime.Region(insertpt-1, insertpt+1))

        # protect from the listener
        view.settings().set('auto_wrap', False)
        view.run_command('auto_wrap_insert', {
            'insertpt': insertpt, 'join': join, "left_delete": self.left_delete
        })
        self.left_delete = left_delete
        # release from the listener
        view.settings().set('auto_wrap', True)
dataset/ETHPy150Open randy3k/AutoWrap/autowrap.py/AutoWrapListener.on_modified/original