Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make Ace editor resize its height accordingly to the number of rows?

What do I do to configure Ace to have its height so that all lines will be always visible, rather than having a vertical scrollbar?

Basically, the equivalent of:

document.querySelector("textarea").oninput = function(){
    this.rows = this.value.split(/\n/g).length;
};

http://jsfiddle.net/obobjrf5/

How do I do that? Thank you in advance.

like image 868
Wes Avatar asked Jan 19 '26 04:01

Wes


1 Answers

Use maxLines option editor.setOption("maxLines", 1000).

like image 73
a user Avatar answered Jan 20 '26 17:01

a user