I'm trying to add the Ace editor to a page, but I don't know how to get the height to be set automatically based on the length of its contents.
Ideally it would work so when the content changes the height is recalculated, but I would be happy with the height just being set on page load.
For a JavaScript novice can someone help me figure out how I work out the length of the code, how many lines it spans, what the new height is and how I update the DOM to reflect this?
I found this suggestion in a Google group, but I don't really understand what it's doing and how I get it to adjust the height.
editor.getSession().getDocument().getLength() *
editor.renderer.lineHeight + editor.renderer.scrollBar.getWidth()