editor: Preserve preview tabs for references multibuffers (#61021)

When `preview_tabs.enabled` and
`preview_tabs.enable_preview_multibuffer_from_code_navigation` are
enabled, Find All References opens its multibuffer as a preview tab.

A references multibuffer is assembled from existing buffers, which may
already contain edits when the preview is created. When creating the
multibuffer to display the references, it ends up emitting edit events
as excerpts are added, this will later cause `Pane::handle_item_edit` to
run, which would see these buffer edits since `Buffer::preview_version`
and unpreview the tab, as the `Buffer::preview_version` value was not
being updated after edits.

Refresh the multibuffer’s preview baseline before opening a newly
created code-navigation multibuffer as a preview. Background diff
updates then preserve the preview, while subsequent user edits still
make it permanent. This leaves the existing editor event and search
invalidation behavior unchanged.

Release Notes:

- Fixed `editor: find all references` preview tabs becoming permanent
tabs if any of the buffers had been edited before

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
b0f145f4aeShuhei Kadowaki committed on 7/23/2026, 6:56:45 PM· committed by GitHubparent9eb6152
2 files changedLine totals unavailable