       atom.workspace.getActiveTextEditor().setCursorBufferPosition(message.range.start)
 
   previousError: ->
-    if @firstRun
-      @firstRun = false
+    if @index?
+      @index--
     else
-      @index--
+      @index = 0
     messages = @linter.views.messages
     message = messages[@index %% messages.length]
     return unless message.filePath

      atom.notifications.addError error.message, {detail: error.stack, dismissable: true}

  nextError: ->
    if @firstRun
      @firstRun = false
    else
      @index++
    messages = @linter.views.messages
    message = messages[@index %% messages.length]
    return unless message.filePath

      'linter:lint': => @lint()

    # Default values
    @index = null

  toggleLinter: ->
    @linter.getActiveEditorLinter()?.toggleStatus()
