Skip to content

Commit 85e2afd

Browse files
committed
format
1 parent c0ceee1 commit 85e2afd

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/core/src/renderables/Diff.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,19 +2274,19 @@ describe("computeInlineHighlights", () => {
22742274

22752275
test("highlights changed words", () => {
22762276
const result = computeInlineHighlights("hello world", "hello there")
2277-
2277+
22782278
// "world" should be highlighted as removed
22792279
expect(result.oldHighlights.length).toBeGreaterThan(0)
22802280
expect(result.oldHighlights[0].type).toBe("removed-word")
2281-
2281+
22822282
// "there" should be highlighted as added
22832283
expect(result.newHighlights.length).toBeGreaterThan(0)
22842284
expect(result.newHighlights[0].type).toBe("added-word")
22852285
})
22862286

22872287
test("computes correct column positions", () => {
22882288
const result = computeInlineHighlights("const x = 1", "const x = 2")
2289-
2289+
22902290
// The "1" is at position 10, "2" is at position 10
22912291
expect(result.oldHighlights[0].startCol).toBe(10)
22922292
expect(result.oldHighlights[0].endCol).toBe(11)
@@ -2296,7 +2296,7 @@ describe("computeInlineHighlights", () => {
22962296

22972297
test("handles multiple changes", () => {
22982298
const result = computeInlineHighlights("a b c", "x b z")
2299-
2299+
23002300
// "a" and "c" should be removed, "x" and "z" should be added
23012301
expect(result.oldHighlights.length).toBe(2)
23022302
expect(result.newHighlights.length).toBe(2)
@@ -2460,7 +2460,7 @@ ${manyAdds}`
24602460
})
24612461

24622462
currentRenderer.root.add(diffRenderable)
2463-
2463+
24642464
// Should not throw or hang - large blocks are skipped
24652465
await renderOnce()
24662466

packages/core/src/renderables/Diff.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ export class DiffRenderable extends Renderable {
227227
this._showWordHighlights = options.showWordHighlights ?? true
228228
this._lineSimilarityThreshold = options.lineSimilarityThreshold ?? 0.4
229229
// Default word highlight colors: brighter versions of the line colors
230-
this._addedWordBg = options.addedWordBg
231-
? parseColor(options.addedWordBg)
232-
: this.brightenColor(this._addedBg, 1.5)
230+
this._addedWordBg = options.addedWordBg ? parseColor(options.addedWordBg) : this.brightenColor(this._addedBg, 1.5)
233231
this._removedWordBg = options.removedWordBg
234232
? parseColor(options.removedWordBg)
235233
: this.brightenColor(this._removedBg, 1.5)

0 commit comments

Comments
 (0)