     cell
 
   inputView: (item) ->
-    model = atom.workspace.textEditorRegistry.build()
+    @lastInput = model = atom.workspace.textEditorRegistry.build()
     atom.textEditors.add model
     ed = atom.views.getView model
     ed.onblur = -> atom.commands.dispatch ed, 'autocomplete-plus:cancel'

    @model.onDidClear => @clear()
    @model.onDidDeleteFirstItems (n) => @deleteFirstItems n
    @model.onDone => if @hasFocus() then @focus()
    @model.onFocusInput (force) => @focusLast force
    @model.onLoading (status) => @loading status
    @model.onDidUpdateItem ({item, key}) =>
      if key is 'icon'    then @updateIcon item

    view = view.getBoundingClientRect()
    pane.bottom >= view.top >= pane.top or pane.bottom >= view.bottom >= pane.top

  enterLastInput: ->
    y = @scrollTop
    atom.views.getView(@lastInput)?.focus()
    s = @lastInput.onDidChange =>
      atom.views.getView(@lastInput)?.focus()
      s.dispose()
    @scrollTop = y

  # Various cell views
  iconView: (name) ->
