simonmysun simonmysun - 1 year ago 111
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download