editor: Fix edge case regression from focus preservation fix