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 / hooks / views / body / plan / segments / segment-rows-of.ts
11 lines · 307 BRaw
1import type { Segment } from '../../types'
2
3/**
4 * The rows a segment takes: a hunk's as counted when it was laid out, one
5 * for anything else.
6 *
7 * @param segment the segment
8 * @returns the rows
9 */
10export const segmentRowsOf = (segment: Segment): number =>
11 segment.kind === 'hunk' ? segment.rows : 1