Fix panic in copilot (#50056) (cherry-pick to preview) (#50058)
zed-zippy[bot]
and
Conrad Irwin
created
Cherry-pick of #50056 to preview
----
Fixes ZED-599
register_buffer() only sometimes registers the buffer
Release Notes:
- Fixed a panic in Copilot completions
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>