diff --git a/builtin/runtime/compile.lua b/builtin/runtime/compile.lua index 20300cc..22fc643 100644 --- a/builtin/runtime/compile.lua +++ b/builtin/runtime/compile.lua @@ -893,11 +893,16 @@ local function start_run(slot, cmdline, opts) -- not preempt the requested panel. Compile output is passive, so it -- takes `select = false` explicitly. -- - -- A recompile reaches here with NO `display` (only cmdline/cwd are - -- stored in `_last`), so the raw switch below would put this buffer in - -- the selected DOCUMENT window while the panel still shows it — the - -- duplicate presentation this arc removes elsewhere. Detect that the - -- buffer already owns the panel slot and keep it there. + -- A recompile REPLAYS `_last`, which since Stage 3 carries `display` + -- alongside cmdline/cwd — an opt-out that did not survive replay + -- would silently revert to the panel on the next `g`. So an explicit + -- `display = "current"` reaches here again on a recompile, and must + -- still take the raw switch below. + -- + -- The `display_omitted` arm remains for the genuinely omitted case: + -- it keeps a buffer that already owns the panel slot in the panel + -- rather than duplicating it into the selected DOCUMENT window while + -- the panel still shows it. -- -- Gated on OMISSION, never on an explicit value: `display = "current"` -- is the documented user-facing opt-out from the Stage 3 default flip, diff --git a/docs/bottom-panel-stage3-framing.md b/docs/bottom-panel-stage3-framing.md index fa59cf2..18ba3b3 100644 --- a/docs/bottom-panel-stage3-framing.md +++ b/docs/bottom-panel-stage3-framing.md @@ -572,9 +572,12 @@ One branch, `bottom-panel-stage3`: measurement is the first commit's evidence, not the flip.* Classify each mover per §1.6a's rule before writing a line of the fix. 2. **Land `resolve_adopter_display`** (Q#S3-1) with all four callers - still passing their CURRENT defaults, so the unification is provably - behaviour-preserving before anything flips. Decide and pin the - non-string normalization here. + still passing their CURRENT defaults, so nothing flips yet. It is + **default-preserving with one intentional normalization**, not + "behaviour-preserving" — every adopter keeps its default and the + suite is byte-identical to baseline, but terminal's invalid-input + behaviour moves deliberately (§1.6b). Decide and pin that + normalization here, since no existing assertion can catch it. 3. **Flip the three sites** by changing only the `default` argument at listview, compile and terminal — dired keeps `"current"` — with per-adopter `select`. diff --git a/tests/compile_mode_crdt_acceptance.rs b/tests/compile_mode_crdt_acceptance.rs index ba79d49..a6970d9 100644 --- a/tests/compile_mode_crdt_acceptance.rs +++ b/tests/compile_mode_crdt_acceptance.rs @@ -105,6 +105,13 @@ where /// the daemon broadcasts a snapshot for the newly-CRDT-backed buffer /// and via the active-buffer-follow path). Re-seats the replica's /// mirror on that buffer. +/// +/// **Bottom-panel Stage 3:** this is why the runs below pass an explicit +/// `display = "current"`. The default now places compile output in the +/// panel with `select = false`, so the ACTIVE buffer never becomes +/// `*compilation*` — and the active-buffer-follow path named above is +/// what publishes the snapshot this function waits for. The subject +/// here is CRDT convergence of a generated buffer, not placement. fn adopt_next_buffer(replica: &mut Replica, what: &str) { let deadline = std::time::Instant::now() + Duration::from_secs(10); loop { @@ -188,7 +195,7 @@ fn compile_run_converges_and_replica_edit_triggers_recovery() { name = "test.compile", description = "compile-mode CRDT fixture trigger", fn = function() - pmacs.compile.run("sh {script}", {{ cwd = "{dir}" }}) + pmacs.compile.run("sh {script}", {{ cwd = "{dir}", display = "current" }}) end, }} pmacs.keymap.bind {{ scope = "global", sequence = "C-c 9", command = "test.compile" }} @@ -275,7 +282,7 @@ fn r3f1_unicode_cr_backspace_survive_crdt_replication() { name = "test.compile-unicode", description = "round-3 unicode fixture trigger", fn = function() - pmacs.compile.run("sh {script}", {{ cwd = "{dir}" }}) + pmacs.compile.run("sh {script}", {{ cwd = "{dir}", display = "current" }}) end, }} pmacs.keymap.bind {{ scope = "global", sequence = "C-c 8", command = "test.compile-unicode" }} @@ -327,7 +334,7 @@ fn r4f1_column_rewrites_replicate_and_converge() { name = "test.compile-columns", description = "round-4 column-rewrite fixture trigger", fn = function() - pmacs.compile.run("sh {script}", {{ cwd = "{dir}" }}) + pmacs.compile.run("sh {script}", {{ cwd = "{dir}", display = "current" }}) end, }} pmacs.keymap.bind {{ scope = "global", sequence = "C-c 7", command = "test.compile-columns" }}