开发者

Is there a way for the Ace editor to preserve indentation upon a newline?

开发者 https://www.devze.com 2023-03-21 03:15 出处:网络
Would be helpful for editing a YAML or Python, 开发者_如何学JAVAfor example.Indentation preservation is configured in the language mode (see f.e. getNextLineIndent), if you don\'t have this it probabl

Would be helpful for editing a YAML or Python, 开发者_如何学JAVAfor example.


Indentation preservation is configured in the language mode (see f.e. getNextLineIndent), if you don't have this it probably is due to no language mode selected. Change the language mode by:

<script src="src/mode-python.js" type="text/javascript" charset="utf-8"></script>

<script>
var PythonMode = require("ace/mode/python").Mode;
editor.getSession().setMode(new PythonMode());
</script>

To get syntax highlighting and auto-indent.

0

精彩评论

暂无评论...
验证码 换一张
取 消