preserve editor state on save