ajaxorg/ace — Issue #485: Request: Option to disable automatic indenting.
Author: evaryont
Created: 2011-10-31 06:41:42+00:00
State: open

I don't think it would be too difficult, since the follow patch shows how to permanently disable auto-indenting. (Not the best way, but I'm just doing this one time. :-) )

```diff
diff --git a/lib/ace/editor.js b/lib/ace/editor.js
index e51b372..9592f49 100644
--- a/lib/ace/editor.js
+++ b/lib/ace/editor.js
@@ -482,6 +482,7 @@ var Editor =function(renderer, session) {
// TODO disabled multiline auto indent
// possibly doing the indent before inserting the text
// if (cursor.row !== end.row) {
+ /*
if (session.getDocument().isNewLine(text)) {
this.moveCursorTo(cursor.row+1, 0);

@@ -518,6 +519,7 @@ var Editor =function(renderer, session) {
}
if (shouldOutdent)
mode.autoOutdent(lineState, session, cursor.row);
+ */
};

this.onTextInput = function(text, notPasted) {
```