feat: lift Cut/Copy/Paste from ted into Editor as first-class commands#107
Conversation
- Add Command.Cut, Command.Copy, Command.Paste handlers in Editor.Commands.cs - Register Ctrl+X/C/V key bindings via DefaultKeyBindings dictionary - Cut and Paste use Document.RunUpdate() for single undo step - No-selection = no-op for Cut/Copy (matching VS Code default) - ReadOnly blocks Cut/Paste; Copy still allowed - Remove redundant Cut/Copy/Paste methods from TedApp.EditCommands.cs - Log DEC-005 decision in specs/decisions.md - Add EditorClipboardTests with round-trip, multi-line, undo, and ReadOnly tests Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/2f4d5823-f52a-4b6e-9125-c65584a6131f Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
@copilot see TG PR #5277 and ensure this work is compatible. It should be, but I just want to make sure. |
Verified — fully compatible. TG PR #5277 introduces a parallel paste pathway ( When #5277 eventually merges, the Editor could optionally override |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb0c8956f7
ℹ️ 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".
|
@copilot see CR feedback. Ensure there's a test that proves the CR feedback (or not) and then fix. CI?CD is failing and that must be fixed too. |
- Cut is now a no-op if TrySetClipboardData returns false (prevents destructive text loss when clipboard is unavailable) - All clipboard tests use FakeClipboard to work on macOS/Windows CI where system clipboard is unavailable in headless mode - New test: Cut_NoOp_When_Clipboard_Unavailable proves the guard Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/500faa4d-d1bf-477f-b2a5-2e599bb69c9e 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. |
Fixed in
|
…rvey All four beta features (find-and-replace #104, clipboard #107, word-wrap #106, multi-caret #105) plus vertical-multi-caret #133 and syntax-theme Phase 2 #134 have merged since the 2026-05-13 plan snapshot. Bring the spec set back in line with develop: - Per-feature status lines -> Done with PR/issue refs (clipboard, multi-caret, find-and-replace, word-wrap, vertical-multi-caret, syntax-theme). - plan.md rescoped to the beta endgame: new "Done (beta)" table, a "Remaining for beta" that reflects no feature work is left (only external/verification/cut items), evidence-checked DoD boxes, refreshed dependency graph and header. - decisions.md: OPEN-005 annotated as settled by syntax-theme; add OPEN-006 (single-line/input-mode decision). - codex-autonomous-sprint.md: flag stale work pool. - New specs/textview-parity-gap/spec.md: survey of TextView capabilities Editor lacks (autocomplete, overwrite mode, single-line mode, kill-ring, context menu) with dispositions; wired into plan.md follow-ups. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Moves clipboard operations from
ted's private helpers intoEditorproper so any consumer gets Cut/Copy/Paste for free viaCommand.Cut/Copy/Paste.Editor commands (
Editor.Commands.cs)Command.Cut,Command.Copy,Command.Pastewith Ctrl+X/C/V inDefaultKeyBindingsSelectedTexttoApp.ClipboardRunUpdate()→ single undo step. Aborts without deleting text ifTrySetClipboardDatareturns false (prevents destructive behavior when clipboard is unavailable).RunUpdate()→ single undo step; multi-line content preserved verbatimted cleanup (
TedApp.EditCommands.cs)Cut(),Copy(),Paste()wrappersCommandalone (noActiondelegate needed)Decision log (
specs/decisions.md)Tests (
EditorClipboardTests.cs)FakeClipboardfor cross-platform CI compatibility (macOS/Windows headless)