From 6075916ef18dc4a8cbea41c941d2d0b519360262 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 26 Jun 2012 13:04:04 -0700 Subject: fixed code hinting and autocompletion bug Signed-off-by: Ananya Sen --- js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/code-editor/codemirror-ninja') 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 4787b4f8..adcafd41 100644 --- a/js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js +++ b/js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js @@ -22,8 +22,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot function insert(str) { editor.replaceRange(str, result.from, result.to); } - // Ninja override: don't autocomplete to reduce user's typing errors -// if (completions.length == 1) {insert(completions[0]); return true;} + + if (completions.length == 1) {insert(completions[0]); return true;} // Build the select widget var complete = document.createElement("div"); -- cgit v1.2.3 From 4544c22b70dd84a88b98e837746a355e85eabec3 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 26 Jun 2012 18:06:03 -0700 Subject: turning off autocompletion since it is interfering typing Signed-off-by: Ananya Sen --- js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/code-editor/codemirror-ninja') 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 adcafd41..97adfd13 100644 --- a/js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js +++ b/js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js @@ -23,7 +23,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot editor.replaceRange(str, result.from, result.to); } - if (completions.length == 1) {insert(completions[0]); return true;} + //if (completions.length == 1) {insert(completions[0]); return true;} // Build the select widget var complete = document.createElement("div"); -- cgit v1.2.3 From dd9c91e14708635dfaba2b31fd7f39938f719ab3 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 27 Jun 2012 10:29:35 -0700 Subject: initialize auto code hinting flag with checkbox value, on switching between documents Signed-off-by: Ananya Sen --- js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/code-editor/codemirror-ninja') 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 97adfd13..99fe2d21 100644 --- a/js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js +++ b/js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js @@ -13,7 +13,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot // Ninja override: don't show code hinting if the token is empty var tempToken = editor.getTokenAt(editor.getCursor()); - if(tempToken && ((tempToken.string === "") || !(/[\S]/gi.test(tempToken.string)))) return;//check that token has only spaces + if(!(/[\S]/gi.test(tempToken.string))) return; var result = getHints(editor); @@ -22,7 +22,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot function insert(str) { editor.replaceRange(str, result.from, result.to); } - + //if (completions.length == 1) {insert(completions[0]); return true;} // Build the select widget -- cgit v1.2.3