def run_to_cursor(w, size, key):
    if self.debugger.post_mortem:
        self.message("Post-mortem mode: Can't modify state.")
    else:
        (sline, pos) = self.source.get_focus()
        lineno = (pos + 1)
        bp_source_identifier = self.source_code_provider.get_source_identifier()
        if (bp_source_identifier is None):
            self.message('Cannot currently set a breakpoint here--source code does not correspond to a file location. (perhaps this is generated code)')
        from pudb.lowlevel import get_breakpoint_invalid_reason
        invalid_reason = get_breakpoint_invalid_reason(bp_source_identifier, lineno)
        if (invalid_reason is not None):
            self.message(('Cannot run to the line you indicated, for the following reason:\n\n' + invalid_reason))
        else:
            err = self.debugger.set_break(bp_source_identifier, (pos + 1), temporary=True)
            if err:
                self.message(('Error dealing with breakpoint:\n' + err))
            self.debugger.set_continue()
            end()
def run_to_cursor(w, size, key):
    if self.debugger.post_mortem:
        self.message("Post-mortem mode: Can't modify state.")
    else:
        (sline, pos) = self.source.get_focus()
        lineno = (pos + 1)
        bp_source_identifier = self.source_code_provider.get_source_identifier()
        if (bp_source_identifier is None):
            self.message('Cannot currently set a breakpoint here--source code does not correspond to a file location. (perhaps this is generated code)')
        from pudb.lowlevel import get_breakpoint_invalid_reason
        invalid_reason = get_breakpoint_invalid_reason(bp_source_identifier, lineno)
        if (invalid_reason is not None):
            self.message(('Cannot run to the line you indicated, for the following reason:\n\n' + invalid_reason))
        else:
            err = self.debugger.set_break(bp_source_identifier, (pos + 1), temporary=True)
            if err:
                self.message(('Error dealing with breakpoint:\n' + err))
            self.debugger.set_continue()
            end()