mirror of
https://github.com/voideditor/void
synced 2026-05-24 01:48:25 +00:00
fix offset collision with deletion
This commit is contained in:
parent
d3647bf93c
commit
dc33d4d0c0
1 changed files with 11 additions and 2 deletions
|
|
@ -636,8 +636,17 @@ class InlineDiffsService extends Disposable implements IInlineDiffsService {
|
|||
offsetLines = 0
|
||||
}
|
||||
else if (diff.type === 'deletion') {
|
||||
startLine = diff.startLine - 1
|
||||
offsetLines = 1
|
||||
// if diff.startLine is out of bounds
|
||||
if (diff.startLine === 1) {
|
||||
const numRedLines = diff.originalEndLine - diff.originalStartLine + 1
|
||||
startLine = diff.startLine
|
||||
offsetLines = -numRedLines
|
||||
}
|
||||
else {
|
||||
startLine = diff.startLine - 1
|
||||
offsetLines = 1
|
||||
}
|
||||
|
||||
}
|
||||
else { throw 1 }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue