Integrate Codex autonomous sprint work#70
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a5f3ba61f
ℹ️ 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".
| anchor.MovementType = anchor.Offset <= CaretOffset | ||
| ? AnchorMovementType.AfterInsertion | ||
| : AnchorMovementType.BeforeInsertion; |
There was a problem hiding this comment.
Preserve selection end on boundary inserts regardless direction
RefreshSelectionAnchorMovement() sets the selection anchor to AfterInsertion whenever anchor.Offset <= CaretOffset, while the caret anchor is always AfterInsertion. With a forward selection, an insertion exactly at SelectionEnd (e.g., from another Editor sharing the same TextDocument) moves the caret boundary forward and expands the selection to include newly inserted text; the same edit on a backward selection does not. This makes selection tracking depend on selection direction and produces inconsistent results for shared-document edits.
Useful? React with 👍 / 👎.
| if (current != _lastKnownCaretOffset) | ||
| { | ||
| _lastKnownCaretOffset = current; | ||
| _virtualCaretColumn = GetCaretColumn (); | ||
| CaretChanged?.Invoke (this, EventArgs.Empty); |
There was a problem hiding this comment.
Recompute virtual caret column after same-length text edits
In OnDocumentChanged, _virtualCaretColumn is only refreshed when CaretOffset changed. For replacements before/at the caret with equal removal/insertion length, the offset can stay identical while the visual column changes (for example, tab/space substitutions). Because MoveCaretVertically() relies on _virtualCaretColumn, subsequent Up/Down navigation can jump to the wrong target column after such edits.
Useful? React with 👍 / 👎.
Summary
This is the final integration PR for the Codex autonomous sprint branch.
Integrated feature PRs already merged into
experiment/codex/develop:drawing-overhaul-complete: source guard/status cleanup for drawing-overhaulcaret-anchors: TextAnchor-backed caret and selection; removes manual caret edit arithmeticread-only:Editor.ReadOnlyand ted read-only flag/menu guardsAlso includes
specs/runs/codex-final.mdwith the sprint report and benchmark notes.Completed specs in this PR
drawing-overhaulcaret-anchorsread-onlyStill not complete from
specs/plan.mdReady but not done:
folding,search,indentation,syntax-highlighting,word-wrap,multi-caret,clipboard.Blocked follow-on work:
find-and-replace(needssearch),word-wrap-toggle(needsword-wrap),folding-ui(needsfolding),auto-indent(needsindentation),syntax-colorizer(needssyntax-highlighting),textmate-grammars(needssyntax-colorizer).Validation
dotnet build Terminal.Gui.Text.slnx- passeddotnet run --project tests/Terminal.Gui.Text.Tests- 212 passeddotnet run --project tests/Terminal.Gui.Editor.Tests- 78 passeddotnet run --project tests/Terminal.Gui.Editor.IntegrationTests- 105 passeddotnet format Terminal.Gui.Text.slnx --exclude third_party/- passeddotnet format Terminal.Gui.Text.slnx --verify-no-changes --exclude third_party/- passeddotnet jb cleanupcode Terminal.Gui.Text.slnx --profile="Full Cleanup"- blocked because the profile is not defineddotnet jb cleanupcode Terminal.Gui.Text.slnx- reported no items to cleanup (tool exited 3)Benchmarks
./benchmarks/compare-baseline.shcurrently does not produce results because it passes--job ShortRun, which BenchmarkDotNet rejects. I manually reran the same focused filter with--job short:dotnet run --project benchmarks/Terminal.Gui.Editor.Benchmarks -c Release -- --filter "*VisualLineBuild*" --job short --exporters jsonVisual-line results vs
benchmarks/baseline.json:All are below the repo's 3x regression threshold.