aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAnanya Sen2012-04-30 13:42:01 -0700
committerAnanya Sen2012-04-30 13:42:01 -0700
commitd548103df7dd1015581d30ebf245003443b47d15 (patch)
treea4c7696eea5558214663e2ef6eb476cf8dbf3d7b /js
parent0e67024be5993049ea6acd9add96b76be6017a4d (diff)
downloadninja-d548103df7dd1015581d30ebf245003443b47d15.tar.gz
added shortkeys for commenting and uncomment
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js')
-rw-r--r--js/controllers/code-editor-controller.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/controllers/code-editor-controller.js b/js/controllers/code-editor-controller.js
index 4a08aa32..7913cfc1 100644
--- a/js/controllers/code-editor-controller.js
+++ b/js/controllers/code-editor-controller.js
@@ -110,6 +110,17 @@ var CodeEditorController = exports.CodeEditorController = Montage.create(Compone
110 _codeCompletionKeyEventHandler:{ 110 _codeCompletionKeyEventHandler:{
111 enumerable:false, 111 enumerable:false,
112 value: function(cm, keyEvent, documentType) { 112 value: function(cm, keyEvent, documentType) {
113 //comment shortkeys
114 if((keyEvent.metaKey || keyEvent.ctrlKey) && !keyEvent.shiftKey && keyEvent.keyCode === 191){//ctrl+/
115 this.commentSelection(true);
116 return;
117 }
118 //uncomment shortkeys
119 if((keyEvent.metaKey || keyEvent.ctrlKey) && keyEvent.shiftKey && keyEvent.keyCode === 191){//ctrl+shift+/
120 this.commentSelection(false);
121 return;
122 }
123
113 //===manually triggered code completion 124 //===manually triggered code completion
114 if((this.automaticCodeComplete === false)){ 125 if((this.automaticCodeComplete === false)){
115 if(keyEvent.ctrlKey && keyEvent.keyCode === 32){//Ctrl+Space 126 if(keyEvent.ctrlKey && keyEvent.keyCode === 32){//Ctrl+Space