aboutsummaryrefslogtreecommitdiff
path: root/js/code-editor
diff options
context:
space:
mode:
authorAnanya Sen2012-06-27 10:29:35 -0700
committerAnanya Sen2012-06-27 10:29:35 -0700
commitdd9c91e14708635dfaba2b31fd7f39938f719ab3 (patch)
treedffaa0bc34c7f8e5ab66d942734b7ee997950dc4 /js/code-editor
parent4544c22b70dd84a88b98e837746a355e85eabec3 (diff)
downloadninja-dd9c91e14708635dfaba2b31fd7f39938f719ab3.tar.gz
initialize auto code hinting flag with checkbox value, on switching between documents
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/code-editor')
-rw-r--r--js/code-editor/codemirror-ninja/lib/ninja-simple-hint.js4
-rw-r--r--js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js1
2 files changed, 3 insertions, 2 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 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
13 13
14 // Ninja override: don't show code hinting if the token is empty 14 // Ninja override: don't show code hinting if the token is empty
15 var tempToken = editor.getTokenAt(editor.getCursor()); 15 var tempToken = editor.getTokenAt(editor.getCursor());
16 if(tempToken && ((tempToken.string === "") || !(/[\S]/gi.test(tempToken.string)))) return;//check that token has only spaces 16 if(!(/[\S]/gi.test(tempToken.string))) return;
17 17
18 18
19 var result = getHints(editor); 19 var result = getHints(editor);
@@ -22,7 +22,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
22 function insert(str) { 22 function insert(str) {
23 editor.replaceRange(str, result.from, result.to); 23 editor.replaceRange(str, result.from, result.to);
24 } 24 }
25 25
26 //if (completions.length == 1) {insert(completions[0]); return true;} 26 //if (completions.length == 1) {insert(completions[0]); return true;}
27 27
28 // Build the select widget 28 // Build the select widget
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
index 6c983867..5a33909c 100644
--- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
+++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
@@ -31,6 +31,7 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
31 } else { 31 } else {
32 this.visible = true; 32 this.visible = true;
33 this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension]; 33 this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension];
34 this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked;
34 } 35 }
35 36
36 } 37 }