   Down: (cm) ->
     cur = cm.getCursor()
     if cur.line is cm.lineCount() - 1
-      next_context = context_at_offset cm.lead_cell, 1
+      next_context = input_cell_at_offset cm.lead_cell, 1
       if next_context?
         next_context.editor.focus()
       else

    else
      CodeMirror.Pass
  'Shift-Up': (cm) ->
    previous_context = context_at_offset cm.lead_cell, -1
    if previous_context?
      cm.setValue previous_context.editor.getValue()
      cm.setCursor(line: cm.lineCount() - 1)

    set_code: add_context
    run: run_in_available_context
    clear_output: -> clear_contexts()
    previously_run: -> input_cell_at_offset(input_cell, -1).editor.getValue()
    hide_input: -> remove_cell input_cell
    value: (value) -> _lead_cli_value: value
    async: (fn) ->
