     else if @state.scope is 'File'
       messages = @messages.filter (message) -> message.currentFile
     else if @state.scope is 'Line'
-      messages = @lineMessages
+      messages = @messagesLine
     @panel.updateMessages messages, @state.scope is 'Project'
 
   renderPanelMarkers: ->

BottomPanel = require('./views/bottom-panel')
BottomContainer = require('./views/bottom-container')
BottomStatus = require('./views/bottom-status')

class LinterViews
  constructor: (@linter) ->
    @state = @linter.state
    @subscriptions = new CompositeDisposable
    @messages = []
    @lineMessages = []
    @markers = []
    @panel = new BottomPanel().prepare()
    @bottomContainer = new BottomContainer().prepare(@linter.state)
    @bottomBar = null

    @subscriptions.add atom.config.observe('linter.underlineIssues', (underlineIssues) =>
      @underlineIssues = underlineIssues
    )
    @subscriptions.add atom.config.observe('linter.showErrorPanel', (showPanel) =>
      @panel.panelVisibility = showPanel

    @updateLineMessages()
    @renderPanelMessages()
    @renderPanelMarkers()
    @renderBubble()

  renderBubble: (point) ->
    @removeBubble()
    return unless @messagesLine.length
    return unless @showBubble
    activeEditor = atom.workspace.getActiveTextEditor()
    return unless activeEditor?.getPath?()
    point = point || activeEditor.getCursorBufferPosition()
    for message in @messagesLine
      continue unless message.range?.containsPoint point
      @bubble = activeEditor.decorateMarker(
        activeEditor.markBufferRange([point, point], {invalidate: 'never'})
        {
          type: 'overlay',
          position: 'tail',
          item: @renderBubbleContent(message)
        }
      )
      break

  renderBubbleContent: (message) ->
    bubble = document.createElement 'div'
    bubble.id = 'linter-inline'
    bubble.appendChild Message.fromMessage(message)
    if message.trace then message.trace.forEach (trace) ->
      bubble.appendChild Message.fromMessage(trace, addPath: true)
    bubble

  renderCount: ->
    count = @linter.messages.getCount()
    count.Line = @messagesLine.length
    @bottomContainer.setCount(count)

  renderPanelMessages: ->
