aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/code-editor/codemirror-ninja-lib/ninja-simple-hint.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/js/code-editor/codemirror-ninja-lib/ninja-simple-hint.js b/js/code-editor/codemirror-ninja-lib/ninja-simple-hint.js
index e2334a45..866e1a8b 100644
--- a/js/code-editor/codemirror-ninja-lib/ninja-simple-hint.js
+++ b/js/code-editor/codemirror-ninja-lib/ninja-simple-hint.js
@@ -2,6 +2,12 @@
2 CodeMirror.simpleHint = function(editor, getHints) { 2 CodeMirror.simpleHint = function(editor, getHints) {
3 // We want a single cursor position. 3 // We want a single cursor position.
4 if (editor.somethingSelected()) return; 4 if (editor.somethingSelected()) return;
5
6 // Ninja override: don't show code hinting if the token is empty
7 var tempToken = editor.getTokenAt(editor.getCursor());
8 if(tempToken && ((tempToken.string === "") || !(/[\S]/gi.test(tempToken.string)))) return;//check that token has only spaces
9
10
5 var result = getHints(editor); 11 var result = getHints(editor);
6 if (!result || !result.list.length) return; 12 if (!result || !result.list.length) return;
7 var completions = result.list; 13 var completions = result.list;