         @codemirror.on 'gutterClick', @handle_gutter_click
 
         @codemirror.setSize '100%', 'auto'
-        if state.current_query?
-            @codemirror.setValue state.current_query
+        if dataexplorer_state.current_query?
+            @codemirror.setValue dataexplorer_state.current_query
         @codemirror.focus() # Give focus
 
         # Track if the focus is on codemirror
         # We use it to refresh the docs once the reql_docs.json is loaded
-        state.focus_on_codemirror = true
+        dataexplorer_state.focus_on_codemirror = true
 
         @codemirror.setCursor @codemirror.lineCount(), 0
         if @codemirror.getValue() is '' # We show suggestion for an empty query only

                    @codemirror.setValue @draft
                    @codemirror.setCursor @codemirror.lineCount(), 0 # We hit the draft and put the cursor at the end
            else if event.type is 'keyup' and event.altKey and event.which is 33 # Page up
                @history_displayed_id = state.history.length
                @codemirror.setValue state.history[state.history.length-@history_displayed_id].query
                event.preventDefault()
                return true
            else if event.type is 'keyup' and event.altKey and event.which is 34 # Page down
                @history_displayed_id = @history.length
                @codemirror.setValue state.history[state.history.length-@history_displayed_id].query
                @codemirror.setCursor @codemirror.lineCount(), 0 # We hit the draft and put the cursor at the end
                event.preventDefault()
                return true

    abort_query: =>
        @disable_toggle_executing = false
        @toggle_executing false
        dataexplorer_state.query_result?.force_end_gracefully()
        @driver_handler.close_connection()

    # Function that execute the queries in a synchronous way.
