Skip to content

Commit 7931f3c

Browse files
committed
Add TODO for a highlighting bug
1 parent acc4a8f commit 7931f3c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/index.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ const TEST_THEME = Object.fromEntries(
99
Object.keys(ThemeColorName).map((name) => [name, {}])
1010
) as Theme;
1111

12-
const replaceColoredText = () => (text: string) => text.replace(/./g, '░');
12+
const replaceColoredText =
13+
(r: number, g: number, b: number) => (text: string) =>
14+
text.replace(/./g, '░');
1315

1416
// Provide a fake chalk implementation to make it easier to read snapshots
15-
// @ts-expect-error
1617
const TEST_CHALK = {
1718
rgb: replaceColoredText,
1819
bgRgb: replaceColoredText,
@@ -521,6 +522,12 @@ index 2e204671f7,e56bba5ab4..ab6229d1b6
521522

522523
test('merge commit with 3 parents', async function () {
523524
// Source: the TypeScript repo
525+
526+
// TODO: The highlighting here is wrong on lines 2792, 2803 and 2804
527+
// It's not easy to repro, but looks like a bug somewhere in
528+
// maintaining spans while merging lines from multiple hunk parts
529+
// into the final formatted line. We end up formatting the line
530+
// numbers with a span from earlier in the string somewhere.
524531
expect(
525532
await transform(`
526533
commit d6d6a4aedfa78794c1b611c13d2ed1d3a66e1798

0 commit comments

Comments
 (0)