Regenerate code editor only when necessary (so we don't lost child focus)