editor: Fix navigate back for locations opened via preview item (#26943)
Closes #25458 When navigating code from a preview tab with `enable_preview_from_code_navigation` set to `true`, "Go Back" from a newly opened tab could focus on the tab to the right instead of returning to the original preview tab. Before, we killed the existing preview tab before opening a new one, which breaking history as the new tab had no reference to the old one. This caused navigation to shift to the next tab on the right. Now, we first add the new tab at the preview index, and then kill the existing preview tab. This preserves the history by linking new preview tab to existing tab. Release Notes: - Fixes an issue where navigating code from a preview tab with `enable_preview_from_code_navigation` set to `true`, "Go Back" from a newly opened tab could focus on the tab to the right instead of returning to the original preview tab.
S
Smit Barmase committed
cb439e672da47dcebfd3df2fac15da846152ac47
Parent: 6b0a282
Committed by GitHub <noreply@github.com>
on 3/17/2025, 7:29:36 PM