 
     # If there is already a focus, we
     # need to wrap some things up with it.
-    if @socketFocus? and @socketFocus isnt focus
+    if @textFocus? and @textFocus isnt focus
 
       # The first of these is an undo operation;
       # we need to add this text change to the undo stack.
       @addMicroUndoOperation 'CAPTURE_POINT'
-      @addMicroUndoOperation new TextChangeOperation @socketFocus, @oldFocusValue
+      @addMicroUndoOperation new TextChangeOperation @textFocus, @oldFocusValue
       @oldFocusValue = null
 
       # The second of these is a reparse attempt.

          throw new Error 'Socket is split.'

      catch
        @extraMarks[@socketFocus.id] =
          model: @socketFocus
          style: {color: '#F00'}

        @redrawMain()

    # Now we're done with the old focus,
    # we can start over.
    #
    # Literally set the focus.
    @socketFocus = focus

    # If we're _unfocusing_, just do so.
    if not focus?

        return setValueResult
      
      if @aceEditor.getFirstVisibleRow() is 0
        @mainScroller.scrollTop = 0
      else
        @mainScroller.scrollTop = @view.getViewNodeFor(@tree).bounds[@aceEditor.getFirstVisibleRow()].y

      setTimeout (=>
