def METHOD_NAME(event=None):
    widget = get_workbench().focus_get()
    if isinstance(widget, CodeViewText):
        text = widget
        if text.has_selection():
            code = text.get("sel.first", "sel.last")
        else:
            code = text.get("insert linestart", "insert lineend")
        # move cursor to next row
        row, col = map(int, text.index("insert").split("."))
        text.mark_set("insert", "{}.{}".format(row + 1, col))
        _submit_code(code)