-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have read the contributing guidelines
Describe the issue
Hello, thank you for this great library!
Given FileDiffMetadata obtained via parsePatchFiles, using diffAcceptRejectHunk throw with an error:
resolveRegion.ts:230 Uncaught Error: pushCollapsedContextLines: missing collapsed context line
at pushCollapsedContextLines (resolveRegion.ts:230:13)
at resolveRegion (resolveRegion.ts:79:5)
at diffAcceptRejectHunk (diffAcceptRejectHunk.ts:24:10)
Reproduction
In the docs example:
pierre/apps/docs/app/diff-examples/Annotations/constants.ts
Lines 140 to 148 in 1a35f2f
| export const ACCEPT_REJECT_EXAMPLE: PreloadFileDiffOptions<AcceptRejectMetadata> = | |
| { | |
| fileDiff: parseDiffFromFile(ACCEPT_REJECT_OLD_FILE, ACCEPT_REJECT_NEW_FILE), | |
| options: { | |
| theme: 'pierre-dark', | |
| diffStyle: 'unified', | |
| }, | |
| annotations: ACCEPT_REJECT_ANNOTATIONS, | |
| }; |
Use a file diff from patch, for example:
fileDiff: parsePatchFiles(`diff --git a/index.html b/index.html
index 36c553c..711c67c 100644
--- a/index.html
+++ b/index.html
@@ -6,8 +6,9 @@
</head>
<body>
<header>
- <h1>Welcome</h1>
- <p>Thanks for visiting</p>
+ <h1>Welcome to Our Site</h1>
+ <p>We're glad you're here</p>
+ <a href="/about" class="btn">Learn More</a>
</header>
<footer>
<p>© Acme Inc.</p>`)[0].files[0],Then accept or reject the hunk.
What browser(s) are you seeing the problem on?
No response
What version of @pierre/diffs are you using?
Tested on main (1a35f2f)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working