aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rw-r--r--js/controllers/code-editor-controller.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/controllers/code-editor-controller.js b/js/controllers/code-editor-controller.js
index 534d4645..52eb47eb 100644
--- a/js/controllers/code-editor-controller.js
+++ b/js/controllers/code-editor-controller.js
@@ -162,5 +162,26 @@ var CodeEditorController = exports.CodeEditorController = Montage.create(Compone
162 autoCodeCompleteElem.style.visibility = "hidden"; 162 autoCodeCompleteElem.style.visibility = "hidden";
163 } 163 }
164 } 164 }
165 },
166
167 getSelectedRange:{
168 value:function(editor){
169 return { from: editor.getCursor(true), to: editor.getCursor(false) };
170 }
171 },
172
173 autoFormatSelection:{
174 value: function(){
175 var range = this.getSelectedRange(this.application.ninja.documentController.activeDocument.editor);
176 this.application.ninja.documentController.activeDocument.editor.autoFormatRange(range.from, range.to);
177 }
178 },
179
180 commentSelection:{
181 value: function(isComment){
182 var range = this.getSelectedRange(this.application.ninja.documentController.activeDocument.editor);
183 this.application.ninja.documentController.activeDocument.editor.commentRange(isComment, range.from, range.to);
184 }
165 } 185 }
186
166}); \ No newline at end of file 187}); \ No newline at end of file