Fixes a crash (stack overflow) on Archive Subtree in the Mac editor when a fold after the archived subtree covers the new end of the text, as with #+STARTUP: overview.
OrgEditor.update loads the new text before setting the mapped folds. Replacing the storage moves the caret to the new end; selectionChanged() found it inside a stale fold, jumped to the fold's old end, was clamped back to the same offset, and recursed. Selection changes are now skipped while isLoading; update sets the caret after the folds.
- Regression test:
BufferTests.updateRemovingTextBeforeAFold - Full
swift testsuite passes.