mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
When no words are found, autocomplete does not raise an exception
This commit is contained in:
@@ -80,8 +80,8 @@ class Autocomplete extends View
|
||||
|
||||
buildWordList: () ->
|
||||
wordHash = {}
|
||||
for word in @currentBuffer.getText().match(@wordRegex)
|
||||
wordHash[word] ?= true
|
||||
matches = @currentBuffer.getText().match(@wordRegex)
|
||||
wordHash[word] ?= true for word in (matches or [])
|
||||
|
||||
@wordList = Object.keys(wordHash)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user