(oldText: string, newText: string)
| 225 | |
| 226 | // Calculate word-level diffs between two text strings |
| 227 | export function calculateWordDiffs(oldText: string, newText: string): DiffPart[] { |
| 228 | // Use diffWordsWithSpace instead of diffWords to preserve whitespace |
| 229 | // This ensures spaces between tokens like > and { are preserved |
| 230 | const result = diffWordsWithSpace(oldText, newText, { |
| 231 | ignoreCase: false |
| 232 | }); |
| 233 | return result; |
| 234 | } |
| 235 | |
| 236 | // Process word-level diffs with manual wrapping support |
| 237 | function generateWordDiffElements(item: DiffLine, width: number, maxWidth: number, dim: boolean, overrideTheme?: ThemeName): React.ReactNode[] | null { |
no outgoing calls
no test coverage detected