javascript Ace editor spaces turns into tabs? -
i'm using ace editor these settings:
ace.getsession().settabsize(2); ace.getsession().setusesofttabs(true); ace.getsession().setusewrapmode(true);
whenever press space automatically indents 2. want indent 2 spaces when press tab, 1 space when press space. how fix it? thanks.
there may setting in code causing this, consider 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>
Comments
Post a Comment