                 KernelManager.startKernel(command.kernelInfo, config, filepath)
 
 
-    createResultBubble: (andMoveDown = false, runAll = false, runAllAbove = false) ->
-        language = @editor.getGrammar().name.toLowerCase()
-
-        codeBlock = @findCodeBlock(runAll, runAllAbove)
-        if codeBlock?
-            [code, row] = codeBlock
-
-        if andMoveDown
-            @moveDown row
-
-        if code?
-            @clearBubblesOnRow(row)
-
-            view = @insertResultBubble(row)
-
-            KernelManager.execute language, code, (result) ->
-                view.spin(false)
-                view.addResult(result)
-
-
-    moveDown: (row) ->
-        lastRow = @editor.getLastBufferRow()
-
-        if row >= lastRow
-            @editor.moveToBottom()
-            @editor.insertNewline()
-            return
-
-        while row < lastRow
-            row++
-            break if not @blank(row)
-
-        @editor.setCursorBufferPosition
-            row: row
-            column: 0
+    createResultBubble: (code, row) ->
+        language = @editor.getGrammar()?.name.toLowerCase()
+        unless language? and KernelManager.languageHasKernel(language)
+            atom.notifications.addError(
+                "No kernel for language `#{language}` found",
+                    detail: "Check that the language for this file is set in Atom
+                             and that you have a Jupyter kernel installed for it."
+            )
+            return
+
+        @startKernelIfNeeded language, (kernel) =>
+            if @watchSidebar?.element.contains(document.activeElement)
+                @watchSidebar.run()
+            else
+                @setStatusBarElement(kernel.statusView.getElement())
+                @setWatchSidebar(kernel.watchSidebar) unless @watchSidebar?
+                @clearBubblesOnRow row
+                view = @insertResultBubble row
+                KernelManager.execute language, code, (result) ->
+                    view.spin false
+                    view.addResult result
 
 
     insertResultBubble: (row) ->

                @markerBubbleMap[marker.id].destroy()
                delete @markerBubbleMap[marker.id]

    run: (andMoveDown = false, runAll = false, runAllAbove = false) ->
        editor = atom.workspace.getActiveTextEditor()
        grammar = editor.getGrammar()
        language = grammar.name.toLowerCase()

        if language? and KernelManager.languageHasKernel(language)
            @startKernelIfNeeded language, (kernel) =>
                if @watchSidebar? and
                        @watchSidebar.element.contains(document.activeElement)
                    @watchSidebar.run()
                else
                    statusView = kernel.statusView
                    @setStatusBarElement(statusView.getElement())
                    if not @watchSidebar?
                        @setWatchSidebar(kernel.watchSidebar)

                    # if not @watchSidebar?
                        # @watchSidebar = new WatchSidebar(kernel, grammar)
                    # @showWatchSidebar()

                    @createResultBubble(andMoveDown, runAll, runAllAbove)
        else
            atom.notifications.addError(
                "No kernel for language `#{language}` found",
                {
                    detail: "Check that the language for this file is set in Atom
                             and that you have a Jupyter kernel installed for it."
                })

    removeStatusBarElement: ->
        if @statusBarElement?

        _.forEach @markerBubbleMap, (bubble) -> bubble.destroy()
        @markerBubbleMap = {}


    clearBubblesOnRow: (row) ->
        buffer = @editor.getBuffer()
        _.forEach buffer.findMarkers({endRow: row}), (marker) =>
