       @updatePathText()
 
     @subscribe @pane, 'cursor:moved', => @updateCursorPositionText()
-    @subscribe @grammarName, 'click', => @pane.viewForActiveItem().trigger 'grammar-selector:show'
+    @subscribe @grammarName, 'click', => @pane.activeView.trigger 'grammar-selector:show'
     @subscribe @pane, 'editor:grammar-changed', => @updateGrammarText()
 
     if git?

      @currentPath.hide()

  updateCursorPositionText: ->
    if position = @pane.viewForActiveItem().getCursorBufferPosition?()
      @cursorPosition.text("#{position.row + 1},#{position.column + 1}").show()
    else
      @cursorPosition.hide()

    @updateCursorPositionText()

  updateGrammarText: ->
    grammar = @pane.activeView.getGrammar?()
    if not grammar? or grammar is syntax.nullGrammar
      @grammarName.hide()
    else
