I'm using ace editor with these settings:
ace.getSession().setTabSize(2);
ace.getSession().setUseSoftTabs(true);
ace.getSession().setUseWrapMode(true);
Whenever I press space it automatically indents it by 2. I only want it to indent by 2 spaces when I press tab, but 1 space when I press space. How do I fix it? Thanks.
There may be another setting in your code that is causing this, consider the following 2 code examples ::
var editor = ace.edit("editor");
editor.session.setOptions({ tabSize: 2, useSoftTabs: true });
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.9/ace.js"></script>
<div id="editor"></div>
var editor = ace.edit("editor");
editor.session.setOptions({ tabSize: 8, useSoftTabs: true });
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.9/ace.js"></script>
<div id="editor"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With