Add column selection for vertical multi-caret#142
Conversation
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/7084fa04-ac77-4d3d-94f6-b5e7835d8bf2 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/7084fa04-ac77-4d3d-94f6-b5e7835d8bf2 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/7084fa04-ac77-4d3d-94f6-b5e7835d8bf2 Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/0e8e70c4-b347-47a0-a400-df1ba195631f Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/0e8e70c4-b347-47a0-a400-df1ba195631f Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/0e8e70c4-b347-47a0-a400-df1ba195631f Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/0e8e70c4-b347-47a0-a400-df1ba195631f Co-authored-by: tig <585482+tig@users.noreply.github.com>
Resolved the merge conflicts and pushed the updated branch. The true develop merge commit is 4e2cfe8, with follow-up validation cleanups through 9531cd8. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot resolve the merge conflicts in this pull request |
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/6e670ead-33a2-45df-a2cc-d33941caef6e Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/6e670ead-33a2-45df-a2cc-d33941caef6e Co-authored-by: tig <585482+tig@users.noreply.github.com>
A keyboard column-select gesture (Ctrl+Shift+Alt+Arrow/Page) tracks its anchor in _keyboardColumnSelectionAnchorOffset. That field was reset only by ClearAdditionalCarets() (the Esc / mouse / rebuild path), not by ClearAdditionalCaretSelections() (the post-edit collapse path used by all four multi-caret edit commands). Typing over a keyboard column selection therefore left the anchor stale: the next Ctrl+Shift+Alt+Arrow resumed from the pre-edit offset/column/row-delta and rebuilt the old column on the now-edited document instead of restarting from the caret. Reset the anchor in ClearAdditionalCaretSelections() so an edit ends the gesture, symmetric with the Esc path. Regression test (red->green): without the fix, type-over then re-extend produces "ay\nay\nabcd" (stale 2-row column corrupts two rows); with the fix it produces "axy\naxd\nabcd" (single row, restarted from caret). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AnsiSnapshot.Verify captures the screen as pure ANSI via IDriver.ToAnsi() into a __snapshots__/*.ans golden. ToAnsi() emits exactly the escape stream that recreates the screen (truecolor/bold/reverse/blink/layout), excluding the non-deterministic terminal cursor, so `cat <file>.ans` reproduces the look and snapshots stay stable. On mismatch the failure prints the plain-text render inline and writes a .ans.actual sibling, so an agent can self-verify the look without a human eyeballing the app. UPDATE_SNAPSHOTS=1 accepts an intended change; SNAPSHOT_DIR overrides root. Inject adds deterministic mouse gestures (Click, multi-waypoint AltDrag) with fixed monotonic timestamps. EditorSnapshotTests records a minimal golden and guards ToAnsi() determinism. *.ans is marked binary in .gitattributes — they are CRLF escape blobs and core.autocrlf would corrupt both the byte compare and `cat` fidelity. A Testing/README.md documents the workflow and the rules that bite; CLAUDE.md now points every agent at it and makes look-verification mandatory for render changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EditorColumnSelectionTests drives the real input pipeline (Inject.AltDrag, keyboard chords) for the column-selection feature and asserts both the semantics (Document.Text, CaretOffset, HasSelection, AdditionalCaretOffsets, single undo scope) and the look (ANSI snapshot). Covers: Alt+drag down / reversed / zero-extent / short-line clamp / multi-waypoint rebuild / collapse-on-plain-click; keyboard Right+Down / PageDown / Left-past-anchor / Esc-collapse; type-then-single-undo. Dogfooding the goldens caught a real test bug: the short-line test snapshotted before the post-type render, capturing the pre-type frame; fixed to render after the edit so the golden proves no padding is written. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the AnsiSnapshot harness (IDriver.ToAnsi() golden-file capture; see gui-cs/Editor PR #142 and gui-cs/Terminal.Gui PR #5343) and a test that pins DrawSingleLineFlat: with Multiline = false a multi-line document flattens onto one row with each newline rendered as a visible ⏎ glyph. The golden reproduces the exact look (`cat` the .ans). *.ans is marked binary in .gitattributes so core.autocrlf cannot corrupt the compare. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI failed on ubuntu/macos (passed on windows): TG's OutputBase.ToAnsi separates rows with StringBuilder.AppendLine() == Environment.NewLine, which is CRLF on Windows and LF elsewhere. Goldens recorded on Windows (CRLF) could never match a Linux/macOS render (LF), and *.ans is committed binary so git did not mask it. AnsiSnapshot now normalizes both the captured ToAnsi() and the on-disk golden to \n before comparing, and writes goldens LF. cat fidelity is unaffected (terminals map LF->CRLF via ONLCR). All goldens re-recorded as LF; *.ans stays binary so Windows core.autocrlf cannot reintroduce CRLF. README updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same fix as gui-cs/Editor PR #142: TG's ToAnsi uses Environment.NewLine for row breaks, so a Windows-recorded golden fails on Linux/macOS CI. AnsiSnapshot now normalizes capture + golden to \n; golden re-recorded LF. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@copilot resolve the merge conflicts in this pull request |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a59c89715
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _selectionAnchor = CreateSelectionAnchor (anchorOffset); | ||
| RefreshSelectionAnchorMovement (); | ||
| SelectionChanged?.Invoke (this, EventArgs.Empty); |
There was a problem hiding this comment.
Clear the primary selection when dismissing a column block
When a column selection has a horizontal extent, SetPrimaryColumnSelection() leaves the primary row selected; pressing Esc then goes through OnKeyDownNotHandled → ClearAdditionalCarets(), which removes only the additional carets and leaves this primary selection highlighted/active. That means Esc does not collapse the column selection back to a single caret as documented in specs/vertical-multi-caret/spec.md and Docs/Help/multi-caret.md, and the next typed character still replaces the primary row's selected text after the user has dismissed multi-caret mode.
Useful? React with 👍 / 👎.
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/9769119c-7b99-4a36-97ce-313bd75f5c69 Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Uh oh!
There was an error while loading. Please reload this page.