   cur = cm.getCursor()
   token = cm.getTokenAt(cur)
   if lead.graphite.has_docs token.string
-    run_in_info_context "docs '#{token.string}'"
+    run_in_info_context cm.lead_cell, "docs '#{token.string}'"
   else if lead.ops[token.string]?
-    run_in_info_context "help #{token.string}"
+    run_in_info_context cm.lead_cell, "help #{token.string}"
 
 CodeMirror.commands.suggest = (cm) ->
   CodeMirror.showHint cm, suggest, async: true

          lead_string = lead.to_string result
          if $.type(result) == 'function'
            ops.text "#{lead_string} is a Graphite function"
            run_in_info_context "docs #{result.values[0]}"
          else
            ops.text "What do you want to do with #{lead_string}?"
            for f in ['data', 'graph', 'img', 'url']

    return null

add_context = (code='') ->
  cell = get_available_context()
  if cell?
    cell.editor.setValue code
  else
    cell = create_input_cell code
    $document.append cell.$el
    cell.rendered()
    contexts.push cell

  {editor} = cell
  editor.focus()
  editor.setCursor(line: editor.lineCount() - 1)
  cell

run_in_available_context = (code) ->
  add_context(code).run()
  add_context()

# Add an input cell above the last input cell
run_in_info_context = (current_cell, code) ->
  last = contexts[contexts.length - 1]
  cell = create_input_cell code
  if current_cell?
    current_cell.$el.before cell.$el
    index = contexts.indexOf cell
  else
    $document.append cell.$el
    index = -1
  cell.rendered()
  contexts.splice index, 0, cell
  cell.run code

create_input_cell = (code) ->
  $el = $ '<div class="cell input"/>'
  $code = $ '<div class="code"/>'
  $el.append $code

  editor = CodeMirror $code.get(0),
    value: code
