 
     if atom.config.get('autocomplete-plus.liveCompletion')
       @currentBuffer.on "changed", (e) =>
+        if e.newText in ["\n", " "]
+          @addLastWordToList e.newText is "\n"
+
         if e.newText.length
           @contentsModified()
         else
           @cancel()
 
   ###
+   * Adds the last typed word to the wordList
+  ###
+  addLastWordToList: (newLine) ->
+    lastWord = @lastTypedWord newLine
+    return unless lastWord
+
+    if @wordList.indexOf(lastWord) < 0
+      @wordList.push lastWord
+
+  ###
    * Defines which key we would like to use for filtering
   ###
   getFilterKey: -> 'word'

    return prefix

  ###
   * As soon as the list is in the DOM tree, it calculates the
   * maximum width of all list items and resizes the list so that
   * all items fit

path = require 'path'
minimatch = require 'minimatch'
SimpleSelectListView = require './simple-select-list-view'
{Editor, $, $$, Range, Point, SelectListView}  = require 'atom'
fuzzaldrin = require 'fuzzaldrin'
Perf = require './perf'
Q = require 'q'
