Compute the editor's scroll width earlier in layout and store it on the layout state, rather than computing it repeatedly.