Fix #12195: split line at cursor applies the continuation style (ellipses) - #13266
Conversation
|
/copilot-review |
|
CI note: the
|
|
Update — the flake now also hits the new upstream SplitManagerTests (5 tests in one run). Decisive evidence this is scheduling-order flakiness, not this PR: on the exact same commit (9acb7a8) with the exact same build (--no-build), run 1 failed those 5 tests and run 2 passed 1448/1448 — the code is byte-identical between the two runs; only xUnit's parallel class scheduling varied. The tests only assert exact split texts and no test in the suite touches the ContinuationStyle setting this PR reads (default None → the added block is inert in the test suite). Same signature as the earlier documented victims (MainMenuKeyboardActivation, SyntaxTextEditor). |
|
/copilot-review |
|
Audit follow-up: TryParse hardening applied (90d844a) — corrupt/legacy config values now fall back to the clean cut instead of throwing. The 5 SplitManagerTests failures in the audit run were traced to the auditor's own throwaway probe leaking static settings (probe deleted); the PR is not responsible. |
There was a problem hiding this comment.
Pull request overview
This PR fixes regression #12195 by making “Split line at cursor” apply the configured continuation style (e.g., trailing ellipsis) after splitting, restoring Subtitle Edit 4 behavior in the v5 UI split flow.
Changes:
- Apply
ContinuationStyleto the split halves viaContinuationUtilitiesafter splitting the subtitle text. - Add
ContinuationStyleenum import to enable parsing the stored continuation-style setting.
| if (ContinuationUtilities.ShouldAddSuffix(subtitle.Text, continuationProfile)) | ||
| { |
There was a problem hiding this comment.
Checked - both continuation helpers already guard empty input: AddPrefixIfNeeded returns the original text when the sanitized halves are both empty (ContinuationUtilities.cs:453-456), and AddSuffixIfNeeded has the same guard (:354-357). An empty second half therefore never gets a marker - the split path is safe as-is. No code change needed.
There was a problem hiding this comment.
You were right. My first reply checked only the helper used for the empty second half. It missed that the non-empty first half still received a trailing ellipsis. Fixed in 62a4daa: continuation markers are now applied only when both split halves contain text. Added a permanent RED/GREEN regression test. Fresh checks: SplitManagerTests 30/30, full local UI suite 1453 passed / 1 skipped / 0 failed, UI build EXIT:0.
|
Independent audit: PASS-WITH-WARNINGS (A3, audit follow-up applied)\n- Issue #12195 point 1: split line at cursor ignored the continuation style \u2014 SplitManager now applies ContinuationUtilities (SE4 parity); throwaway probe: 'Hello world foo bar' \u2192 'Hello world foo\u2026'/'bar' with OnlyTrailingEllipsis\n- Audit follow-up (90d844a): Enum.TryParse hardening (corrupt/legacy config falls back to clean cut instead of throwing); the 5 SplitManagerTests failures in the audit run were traced to the auditor's own probe leaking static settings (deleted) \u2014 not this PR\n- Mergeable. |
|
This test failure is not caused by this change.\n\nHere is what we checked:\n- The test that fails is different every time. One run: text editor test. Next run: menu test. Next run: another test.\n- We ran the full test list on this computer with this exact code. Result: all tests passed (1448 of 1448).\n- The failing tests pass when we run them alone.\n- The failing tests are not related to this PR. They test other parts of the program.\n\nWhy does this happen? The test system runs many tests at the same time (in parallel). Sometimes tests share the same settings and one test changes a setting that another test is reading. Then the second test fails. The next time we run, the order is different, so a different test fails. We see this on many PRs (also #13244, #13253, #13262, #13264). It is a known problem in the test system, not a bug in the code change.\n\nWe are preparing a separate PR that fixes this problem in the test system. |
51539ff to
0625608
Compare
|
FINAL AUDIT #13266 for issue #12195 point 1: PASS\n\nFresh head: 0625608; one Ironship commit; two focused files. The continuation block is reachable for every SplitManager split path, is inert for None or corrupt/legacy enum values, reuses existing ContinuationUtilities, and runs before FixTags/timing calculations. No unrelated behavior or dead code found.\n\nAudit follow-up: added one permanent regression test with global setting restored in finally. It FAILS on the parent commit and PASSES on this fix; all SplitManagerTests pass 29/29 and UI build exits 0. |
… style (ellipses)
0625608 to
62a4daa
Compare
niksedk
left a comment
There was a problem hiding this comment.
Approve
Checked the thing that decides whether this is safe to ship: SeGeneral.cs:141 sets ContinuationStyle = ContinuationStyle.None.ToString() as the default, and the new block is gated on continuationStyle != ContinuationStyle.None. So for anyone who has not deliberately chosen a continuation style this is a no-op, and for anyone who has, it restores the SE4 behaviour they configured. That is the right shape for #12195.
The guards are complete: both halves must be non-empty, the setting must parse, and ShouldAddSuffix still has the final say — so a line already ending in a suffix, or a split that leaves nothing on the right, is untouched. Split_WithoutSecondHalf_DoesNotAddContinuationMarker covers that second case explicitly.
Note for later, not a blocker: only the trailing-ellipsis path is covered by a test. The leading-marker branch (AddPrefixIfNeeded, used by LeadingTrailingEllipsis — which several built-in profiles select) is exercised by no test. Worth adding, since profile users will hit it.
Merging.
Problem
Fixes #12195 (point 1) — "Split line at cursor" does a clean cut in SE 5.1.0, while SE 4 appended the continuation marker per the configured continuation style (the reporter's "Ellipses (right only)" =
OnlyTrailingEllipsis). The SplitManager never applied the continuation style.Fix
src/ui/Logic/ISplitManager.cs— after the text split, the configuredContinuationStyleis applied to the two halves via the existingContinuationUtilities(same code path SE 4 used): a trailing ellipsis on the first line and a leading marker on the second for leading styles. Markers are applied only when both split halves contain text;Noneand an empty second half leave the clean cut unchanged.Verification
dotnet build src/ui/UI.csproj— EXIT:0, 0 errorsSplit_WithTextIndex_AppliesConfiguredContinuationStyleregression test:ContinuationStyle=OnlyTrailingEllipsis, split "Hello world foo bar" at cursor → first halfHello world foo…(U+2026), secondbar; proven RED on the parent commit and GREEN on this fixHello…), GREEN after it (Hello+ empty second half)SplitManagerTests: 30/30 passedNotes