Files
turbo-debug.nvim/lua
swaitsandClaude Opus 4.6 372afcdd4f fix: focus source window before dap jumps on event_stopped
When stepping into a library file (e.g., Rust stdlib fmt.rs) or any
file not already open, dap uses its switchbuf logic to decide which
window to load the new source into. The 'uselast' variant targets the
current window if it looks like source (empty buftype or matching
filetype); otherwise it falls back to `winnr('#')`.

Problem: if the user pressed `s` / `d` / `r` while focus was on a
dapui pane (which is common — clicking into Scopes or Watches to
inspect, then stepping), or if the event fires while focus is on our
bar window, dap's current-window check fails and it dumps the new
source into whatever `winnr('#')` resolves to. Combined with
bufferline.nvim's tabline, this produces the chrome-breaking layout
shown in the screenshot.

Fix: register `dap.listeners.before.event_stopped` that shifts focus
to a known source window (via the existing source_window() helper)
BEFORE dap's jump handler runs. Dap's uselast then sees a real source
window as current and lands the new file there. Chrome stays intact.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 15:11:24 -06:00
..