ranjeet kumar
ranjeet kumar

Reputation: 271

Is there an option in ace editor to avoid horizontal scroll bar?

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.

Upvotes: 3

Views: 2996

Answers (2)

am2505
am2505

Reputation: 2404

Add wrap: 1 in the options

editor = ace.edit("editor", {
  wrap: 1
})

Upvotes: 4

a user
a user

Reputation: 24169

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>

Upvotes: 7

Related Questions