Less fragile way to deal with updating the scrollbar during editor width changes

Issue #2745