resize editor when its width/height changes