Skip to content

Commit

Permalink
remove useless state var
Browse files Browse the repository at this point in the history
  • Loading branch information
despairblue committed Jul 1, 2015
1 parent df10d55 commit 8a5947b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/commands.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class Commands
'linter:lint': => @lint()

# Default values
@firstRun = true
@index = 0
@index = null

toggleLinter: ->
@linter.getActiveEditorLinter()?.toggleStatus()
Expand Down Expand Up @@ -53,10 +52,10 @@ class Commands
atom.notifications.addError error.message, {detail: error.stack, dismissable: true}

nextError: ->
if @firstRun
@firstRun = false
else
if @index?
@index++
else
@index = 0
messages = @linter.views.messages
message = messages[@index %% messages.length]
return unless message.filePath
Expand All @@ -65,10 +64,10 @@ class Commands
atom.workspace.getActiveTextEditor().setCursorBufferPosition(message.range.start)

previousError: ->
if @firstRun
@firstRun = false
else
if @index?
@index--
else
@index = 0
messages = @linter.views.messages
message = messages[@index %% messages.length]
return unless message.filePath
Expand Down

0 comments on commit 8a5947b

Please sign in to comment.