Thanks, but actually, I found a similar approach. I create the editor while not visible, not worrying about the vertical size. Then, I can query both inner-lines and num-lines. I then increase the inner-lines to match the num-lines, and make the editor visible.