aboutsummaryrefslogtreecommitdiff
path: root/js/code-editor/codemirror-ninja-lib
diff options
context:
space:
mode:
authorAnanya Sen2012-04-26 13:58:54 -0700
committerAnanya Sen2012-04-26 13:58:54 -0700
commitb036813ded46a3b66644c451dc2a619389800edf (patch)
tree3f7976a1555f6843487de442631d5012b5db9585 /js/code-editor/codemirror-ninja-lib
parentb2132103b12e499f26e6e0f311d48555a9f733ff (diff)
downloadninja-b036813ded46a3b66644c451dc2a619389800edf.tar.gz
IKNINJA-1534: don't show code hinting automatically, when word removed via backspaces
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/code-editor/codemirror-ninja-lib')
-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;