     ##########################################
     get_cell_flagstring: (marker) =>
         pos = marker.find()
-        return @codemirror.getRange({line:pos.from.line,ch:37},{line:pos.from.line, ch:pos.to.ch-1})
+        return @focused_codemirror().getRange({line:pos.from.line,ch:37},{line:pos.from.line, ch:pos.to.ch-1})
 
     set_cell_flagstring: (marker, value) =>
         pos = marker.find()
-        @codemirror.replaceRange(value, {line:pos.from.line,ch:37}, {line:pos.to.line, ch:pos.to.ch-1})
+        @focused_codemirror().replaceRange(value, {line:pos.from.line,ch:37}, {line:pos.to.line, ch:pos.to.ch-1})
 
     get_cell_uuid: (marker) =>
         pos = marker.find()
-        return @codemirror.getLine(pos.line).slice(1,38)
+        return @focused_codemirror().getLine(pos.line).slice(1,38)
 
     set_cell_flag: (marker, flag) =>
         s = @get_cell_flagstring(marker)

                    @editor.set_readonly_ui()

                @codemirror.setOption('readOnly', @readonly)
                @editor.codemirror1.setOption('readOnly', @readonly)
                if @_last_sync?
                    # We have sync'd before.
                    synced_before = true

            toggle_input  : false  # if true; toggle whether input is displayed; ranges all toggle same as first
            toggle_output : false  # if true; toggle whether output is displayed; ranges all toggle same as first
            delete_output : false  # if true; delete all the the output in the range
            cm      : @focused_codemirror()
        if opts.pos?
            pos = opts.pos
        else
