最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Is there an option in ace editor to avoid horizontal scroll bar? - Stack Overflow

programmeradmin1浏览0评论

In ace editor if the text is too long, a horizontal scroll bar is appearing, is there an option in ace editor, if text is too long it automatically breaks in multiple lines.

In ace editor if the text is too long, a horizontal scroll bar is appearing, is there an option in ace editor, if text is too long it automatically breaks in multiple lines.

Share Improve this question asked Jul 2, 2019 at 12:22 ranjeet kumarranjeet kumar 2713 silver badges10 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

Yes, use wrap: true option.

<script src=https://ajaxorg.github.io/ace-builds/src/ace.js></script>
<div id=editor style="height:90vh"></div>
<script>
editor = ace.edit("editor", {
  wrap: true, 
  value: "very long line ".repeat(120)
})
</script>

Add wrap: 1 in the options

editor = ace.edit("editor", {
  wrap: 1
})
发布评论

评论列表(0)

  1. 暂无评论