spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / tests / fixtures / code-blocks-of / wide-hunk.ts
25 lines · 728 BRaw
1import type Git from '../../../hooks/git'
2import { WIDE_LINE_LETTERS } from './wide-line-letters.js'
3
4/**
5 * A hunk of wide lines cycling context, removed and added: at its defaults
6 * two share a `Code` and three do not.
7 *
8 * @param start the first line's number on both sides
9 * @param count how many lines
10 * @param letter the character each line repeats WIDE_LINE_LETTERS times
11 * @returns the hunk
12 */
13export function wideHunk(start = 1, count = 40, letter = 'x'): Git.Hunk {
14 const markers = [' ', '-', '+']
15
16 return {
17 oldStart: start,
18 newStart: start,
19 lines: Array.from(
20 { length: count },
21 (_, row) =>
22 `${markers[row % markers.length]}${letter.repeat(WIDE_LINE_LETTERS)}`,
23 ),
24 }
25}