simonmysun simonmysun - 4 months ago 33
Javascript Question

How to get the total height of ACE Editor documents?

I searched the internet and found this:

editor.getSession().getDocument().getLength() * editor.renderer.lineHeight + editor.renderer.scrollBar.getWidth()

But it is assuming there's no line wraps. If I have set
It will don't work, giving the wrong height.

How can I get the total height?


use session.getScreenLength() * editor.renderer.lineHeight or editor.renderer.layerConfig.maxHeight See