     # Returns start and end lines of the current input block (if line is undefined),
     # or of the block that contains the given line number.
     current_input_block: (line) =>
-        cm = @codemirror
+        cm = @focused_codemirror()
         if not line?
             line = cm.getCursor().line
 


        if not start?
            start = 0

        @pad_bottom_with_newlines(10)

        for line in [start...cm.lineCount()]
            x = cm.getLine(line)

        interact_elt.sage_interact(desc:desc, execute_code:@execute_code, process_output_mesg:@process_output_mesg)

    jump_to_output_matching_jquery_selector: (selector) =>
        cm = @focused_codemirror()
        for x in cm.getAllMarks()
            t = $(x.replacedWith).find(selector)
            if t.length > 0
