editor: Fix panic when confirming completion across buffers (#59471)

In multi-buffer context, `do_completion` resolved the completion's
replace range anchors against whichever buffer currently held the newest
selection. If that selection had moved into a different file's excerpt
(while the menu remained open), the anchors belonged to a different
buffer and caused a panic.

This PR adds a guard to confirm the completion buffer and selection
buffer is the same.

Closes FR-76.

---

Release Notes:

- Fixed a panic that could occur when confirming a completion in a
multibuffer if the cursor had moved into a different file
2ec0e6c2d7Neel committed on 7/2/2026, 1:07:34 PM· committed by GitHubparent442a347
2 files changedLine totals unavailable