mirror of
https://github.com/voideditor/void
synced 2026-05-24 01:48:25 +00:00
re-add deletion logic
This commit is contained in:
parent
4ca16caa4e
commit
3d1df92f6a
1 changed files with 8 additions and 8 deletions
|
|
@ -1215,14 +1215,14 @@ class InlineDiffsService extends Disposable implements IInlineDiffsService {
|
|||
// C
|
||||
if (diff.type === 'deletion') {
|
||||
// if startLine is out of bounds (deleted lines past the diffarea), applyEdit will do a weird rounding thing, to account for that we apply the edit the line before
|
||||
// if (diff.startLine - 1 === diffArea.endLine) {
|
||||
// writeText = '\n' + diff.originalCode
|
||||
// toRange = { startLineNumber: diff.startLine - 1, startColumn: Number.MAX_SAFE_INTEGER, endLineNumber: diff.startLine - 1, endColumn: Number.MAX_SAFE_INTEGER }
|
||||
// }
|
||||
// else {
|
||||
writeText = diff.originalCode + '\n'
|
||||
toRange = { startLineNumber: diff.startLine, startColumn: 1, endLineNumber: diff.startLine, endColumn: 1 }
|
||||
// }
|
||||
if (diff.startLine - 1 === diffArea.endLine) {
|
||||
writeText = '\n' + diff.originalCode
|
||||
toRange = { startLineNumber: diff.startLine - 1, startColumn: Number.MAX_SAFE_INTEGER, endLineNumber: diff.startLine - 1, endColumn: Number.MAX_SAFE_INTEGER }
|
||||
}
|
||||
else {
|
||||
writeText = diff.originalCode + '\n'
|
||||
toRange = { startLineNumber: diff.startLine, startColumn: 1, endLineNumber: diff.startLine, endColumn: 1 }
|
||||
}
|
||||
}
|
||||
// if it was an insertion, need to delete all the lines
|
||||
// (this image applies to writeText and toRange, not newOriginalCode)
|
||||
|
|
|
|||
Loading…
Reference in a new issue