MCPcopy Index your code
hub / github.com/anomalyco/opencode / diffLineIndex

Function diffLineIndex

packages/session-ui/src/pierre/diff-selection.ts:18–30  ·  view source on GitHub ↗
(split: boolean, node: HTMLElement)

Source from the content-addressed store, hash-verified

16}
17
18export function diffLineIndex(split: boolean, node: HTMLElement) {
19 const raw = node.dataset.lineIndex
20 if (!raw) return
21
22 const values = raw
23 .split(",")
24 .map((x) => parseInt(x, 10))
25 .filter((x) => !Number.isNaN(x))
26 if (values.length === 0) return
27 if (!split) return values[0]
28 if (values.length === 2) return values[1]
29 return values[0]
30}
31
32export function diffRowIndex(root: ShadowRoot, split: boolean, line: number, side: DiffSelectionSide | undefined) {
33 const rows = Array.from(root.querySelectorAll(`[data-line="${line}"], [data-alt-line="${line}"]`)).filter(

Callers 2

markCommentedDiffLinesFunction · 0.90
diffRowIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected