@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 03:37 UTC

main
ts 17 lines 719 Bytes
Raw
1 // A withheld file's diff line the server cut short ends in this note, which clients style apart.
2 const CUT_LINE_NOTE = / …\[[\d,]+ more characters\]$/;
3
4 export function cutLineNote(omittedCharacters: number): string {
5 return ` …[${omittedCharacters.toLocaleString("en-US")} more characters]`;
6 }
7
8 /** Where a cut line's note starts, past its leading space, or null for a whole line. */
9 export function cutLineNoteStart(line: string): number | null {
10 if (!line.endsWith("more characters]")) return null;
11 const note = CUT_LINE_NOTE.exec(line);
12 return note === null ? null : note.index + 1;
13 }
14
15 export function hasCutLines(patch: string): boolean {
16 return new RegExp(CUT_LINE_NOTE.source, "m").test(patch);
17 }