export function stripReadLineNumberPadding(line: string): {
  text: string
  removedCells: number
} {
  const s = String(line ?? '')
  const m = s.match(/^( +)(?=\d+\|)/)
  if (!m) return { text: s, removedCells: 0 }
  const n = m[1]!.length
  return { text: s.slice(n), removedCells: n }
}

export function splitReadGutter(
  normalizedLine: string,
): { gutter: string; content: string } | null {
  const s = String(normalizedLine ?? '')
  const m = s.match(/^(\d+\|)(.*)$/)
  if (!m) return null
  return { gutter: m[1]!, content: m[2] ?? '' }
}
