Files
oh-my-pi/packages/coding-agent/src/edit/edit-clipboard.ts
T
can1357 e05f229f43 refactor: standardized editing syntax by removing copy and delete operations
- Removed copy and delete operations across tokenizer, parser, grammar, and clipboard logic.
- Standardized line-editing operations and block resolvers to use cut exclusively.
- Updated documentation, prompts, and test suites to reflect the removal of copy and delete syntax.
2026-07-30 07:42:48 +02:00

24 lines
789 B
TypeScript

/**
* Session-bound edit clipboard register.
*
* `CUT`/`PASTE` hashline ops share one {@link Clipboard} per session so
* content captured by one edit call can be pasted by a later one (and across
* files within one call). The executor works on a fork per batch and commits
* it back only after every write lands — see `executeHashlineSingle`.
*/
import type { Clipboard } from "@oh-my-pi/hashline";
interface EditClipboardOwner {
editClipboard?: Clipboard;
}
/**
* Look up (or lazily create) the clipboard register attached to a session.
* Storage lives on `session.editClipboard` so it ages out exactly with the
* session itself.
*/
export function getEditClipboard(session: EditClipboardOwner): Clipboard {
session.editClipboard ??= {};
return session.editClipboard;
}