@trendr/core 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/diff-view.js +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trendr/core",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "direct-mode TUI renderer with JSX, signals, and per-cell diffing",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Pyers",
package/src/diff-view.js CHANGED
@@ -75,6 +75,7 @@ export function Diff({
75
75
  wordDiff = true,
76
76
  context = Infinity,
77
77
  lineNumbers = true,
78
+ folds = true,
78
79
  focused = true,
79
80
  scrollOffset: offsetProp,
80
81
  onScroll,
@@ -88,7 +89,11 @@ export function Diff({
88
89
  const offset = offsetProp ?? offsetInternal()
89
90
  const setOffset = onScroll ?? setOffsetInternal
90
91
 
91
- const { rows, stats } = memoComputeDiff({ before, after, patch, hunks, wordDiff, context })
92
+ const computed = memoComputeDiff({ before, after, patch, hunks, wordDiff, context })
93
+ const stats = computed.stats
94
+ // the gutter numbers already show the jump across elided regions, so a
95
+ // caller can drop the fold banners entirely
96
+ const rows = folds ? computed.rows : computed.rows.filter((r) => r.type !== 'fold')
92
97
 
93
98
  const wholeMode = hunks == null && patch == null
94
99
  const hiLines = (text) => {