diff --git a/lib/tern.js b/lib/tern.js
index <HASH>..<HASH> 100644
--- a/lib/tern.js
+++ b/lib/tern.js
@@ -453,7 +453,8 @@
     if (query.end == null) throw new Error("missing .query.end field");
     var wordStart = resolvePos(file, query.end), wordEnd = wordStart, text = file.text;
     while (wordStart && /\w$/.test(text.charAt(wordStart - 1))) --wordStart;
-    while (wordEnd < text.length && /\w$/.test(text.charAt(wordEnd))) ++wordEnd;
+    if (query.expandWordForward !== false)
+      while (wordEnd < text.length && /\w$/.test(text.charAt(wordEnd))) ++wordEnd;
     var word = text.slice(wordStart, wordEnd), completions = [];
     var wrapAsObjs = query.types || query.depths || query.docs || query.urls || query.origins;
Add expandWordForward option to completions query interface

Issue #<I>