Skip to content

Commit 2e5fd68

Browse files
committed
Add tern_inhibit_word_completions config option
1 parent b3c1b3a commit 2e5fd68

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ plugins for a project. See the [Tern docs][docs] for details.
9090

9191
[docs]: http://ternjs.net/doc/manual.html#configuration
9292

93+
`tern_inhibit_word_completions` (boolean, default to false)
94+
If true, Prevents Sublime Text from adding its word completions to the completion list after all plugins have been processed. This consists of any word in the current document that is longer than 3 characters.
95+
9396
### Automatically Showing Completions
9497

9598
Add `{"selector": "source.js", "characters": "."}` to your

Tern.sublime-settings

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"tern_argument_completion": false,
55
// Used to get auto completion for unsaved buffers
66
// By default, this folder is inside Packages/tern_for_sublime/
7-
"tern_default_project_dir": "default_project_dir"
8-
}
7+
"tern_default_project_dir": "default_project_dir",
8+
"tern_inhibit_word_completions": false
9+
}

tern.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ def on_query_completions(self, view, prefix, _locations):
6666

6767
if not fresh:
6868
completions = [c for c in completions if c[1].startswith(prefix)]
69-
return completions
7069

70+
flags = 0;
71+
if get_setting("tern_inhibit_word_completions", False):
72+
flags |= sublime.INHIBIT_WORD_COMPLETIONS
73+
74+
return (completions, flags)
7175

7276
class ProjectFile(object):
7377
def __init__(self, name, view, project):

0 commit comments

Comments
 (0)