From d76cc521bd2198b8a4e36fbc8d25e8a53909e46a Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Thu, 10 May 2012 10:39:09 -0700 Subject: [PATCH] When no words are found, autocomplete does not raise an exception --- src/extensions/autocomplete.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extensions/autocomplete.coffee b/src/extensions/autocomplete.coffee index daa802b98..a58ea2ea0 100644 --- a/src/extensions/autocomplete.coffee +++ b/src/extensions/autocomplete.coffee @@ -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)