Skip to content

Commit 1e75e8c

Browse files
committed
bugfiks
1 parent a733fb6 commit 1e75e8c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

‎cli.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ const cli = require(`commander`)
55

66
const { readFileSync } = require('fs')
77

8-
9-
108
async function main() {
119

1210
cli
@@ -17,7 +15,7 @@ async function main() {
1715
console.log(` Example:`)
1816
console.log(``)
1917
console.log(` $ splitdiff file1 file2`)
20-
console.log(` $ git diff file1 file2 | splitdiff`)
18+
console.log(` $ git diff --no-pager file1 file2 | splitdiff`)
2119
console.log(``)
2220
})
2321
.parse(process.argv)

‎index.js‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ class Pair {
2929
this.left.padLines(-misalignmentDelta)
3030
}
3131
}
32+
padLines(n) {
33+
this.left.padLines(n)
34+
this.right.padLines(n)
35+
}
3236
drawLines() {
3337
this.left.drawLine()
3438
this.right.drawLine()
3539
}
3640
combine() {
37-
this.drawLines()
41+
// this.drawLines()
3842

3943
if(this.left.sanctioned && this.left.sanctioned.length > 0 && !this.left.sanctioned[this.left.lineLength]) this.left.ellipses()
4044
if(this.right.sanctioned && this.right.sanctioned.length > 0 && !this.right.sanctioned[this.right.lineLength]) this.right.ellipses()
@@ -255,8 +259,7 @@ module.exports = {
255259
)
256260

257261
pair.drawLines()
258-
pair.left.currentSourceLine = ''
259-
pair.right.currentSourceLine = ''
262+
pair.padLines(1)
260263
output.push(pair.combine())
261264

262265
for(let hunk of patch.hunks) {
@@ -285,8 +288,7 @@ module.exports = {
285288
pair.align()
286289
pair.left.currentSourceLine = line
287290
pair.right.currentSourceLine = line
288-
pair.left.drawLine()
289-
pair.right.drawLine()
291+
pair.drawLines()
290292
}
291293

292294
if(symbol === '-') {

0 commit comments

Comments
 (0)