mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Don't adjust match index when no matches exist
This commit is contained in:
@@ -135,11 +135,13 @@ class Autocomplete extends View
|
||||
@css(left: left, top: potentialTop, bottom: 'inherit')
|
||||
|
||||
selectPreviousMatch: ->
|
||||
return if @filteredMatches.length is 0
|
||||
previousIndex = @currentMatchIndex - 1
|
||||
previousIndex = @filteredMatches.length - 1 if previousIndex < 0
|
||||
@selectMatchAtIndex(previousIndex)
|
||||
|
||||
selectNextMatch: ->
|
||||
return if @filteredMatches.length is 0
|
||||
nextIndex = (@currentMatchIndex + 1) % @filteredMatches.length
|
||||
@selectMatchAtIndex(nextIndex)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user