fix: adapter timeouts + bars now span full editor width

Regression fixes from the previous commit:

1. Debug adapter timing out / general slowness — root cause was calling
   dapui.setup() on every M.enter() to "refresh layouts". setup is
   heavy (tears down windows, re-registers listeners, rebuilds state)
   and running it while the adapter handshake is in flight caused
   "Debug adapter didn't respond" timeouts. Reverted to one-time setup;
   layouts are computed once per nvim session. Trade-off: Console/
   sidebar proportions may drift slightly if the terminal is resized
   between toggles, but that's vastly preferable to a broken adapter.

2. Console broken / unreachable — clear_console was calling buf_set_lines
   on a terminal buffer after dapui had made it a terminal, which leaves
   the terminal in an inconsistent state. Kept the config option but
   disabled by default (clear_console_on_start = false). Users who want
   it can opt in; the feature remains risky on terminal-backed Console
   buffers. Better design pending.

3. Bars not spanning full editor width — :topleft split and :botright
   split create full-width splits only when no competing vertical
   splits exist. dapui's sidebar creates a full-height vertical split
   AFTER our bars, which squeezes the bars into the non-sidebar column.
   Added force_bars_full_width() which runs `wincmd K` (on sbar) and
   `wincmd J` (on cbar) AFTER dapui.open(). These commands re-layout
   the window tree with the bar window spanning full editor width,
   pushing sidebar + source + tray into the middle rows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 4.6 committed 2026-04-12 14:18:28 -06:00
1 parent 988bd06d54
commit c7e9fb799d
2 files changed
+81 -41

No files matched your search

+6 -3
View File
@@ -30,9 +30,12 @@ M.defaults = {
-- it. Users can click/<CR> to expand manually.
collapsed_scopes = { "Registers" },
-- Clear the Console pane on session start/restart so old output from a
-- previous run doesn't linger. Set false to preserve across runs.
clear_console_on_start = true,
-- Clear the Console pane on session start/restart. Disabled by default
-- because safe clearing is tricky: dapui's console buffer becomes a
-- terminal buffer once a session starts, and manipulating terminal
-- buffers mid-session destabilizes the adapter. Opt in explicitly if
-- you want it and accept the risk.
clear_console_on_start = false,
-- modal keys (active only during debug mode, single-key)
keys = {