react-diff-view
Advanced tools
Comparing version 1.4.2 to 1.4.3
{ | ||
"name": "react-diff-view", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "A git diff component to consume the git unified diff output.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -479,1 +479,5 @@ # react-diff-view | ||
- Update `gitdiff-parser` to fix an issue when there is only one line in diff. | ||
### 1.4.3 | ||
- Fix an issue where `sliceHunk` function will remove all insert changes in slice range. |
@@ -163,4 +163,7 @@ import leven from 'leven'; | ||
const sliceHunk = (hunk, startOldLineNumber, endOldLineNumber) => { | ||
const singleHunkArray = [hunk]; | ||
const isInRange = change => { | ||
const oldLineNumber = computeOldLineNumber(change); | ||
const oldLineNumber = change.isInsert | ||
? getCorrespondingOldLineNumber(singleHunkArray, change.lineNumber) | ||
: computeOldLineNumber(change); | ||
return oldLineNumber >= startOldLineNumber | ||
@@ -167,0 +170,0 @@ && (endOldLineNumber === undefined || oldLineNumber < endOldLineNumber); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
595934
1560
483