@@ -38,8 +38,8 @@ const renderPrev = (diffs: Array<Change>) => {
3838 const type = getDiffType ( diff )
3939 const prevDiff = index > 0 ? diffs [ index - 1 ] : null
4040 const nextDiff = index < diffs . length - 1 ? diffs [ index + 1 ] : null
41- const isModifiedLine = nextDiff && diff . count === 1 && nextDiff . count === 1 && type === 'removed' && nextDiff . added
42- const isUnuseLine = prevDiff && diff . count === 1 && prevDiff . count === 1 && type === 'added' && prevDiff . removed
41+ const isModifiedLine = nextDiff && diff . count === nextDiff . count && type === 'removed' && nextDiff . added
42+ const isUnuseLine = prevDiff && diff . count === prevDiff . count && type === 'added' && prevDiff . removed
4343
4444 if ( isUnuseLine ) return
4545
@@ -74,8 +74,8 @@ const renderCurrent = (diffs: Array<Change>) => {
7474 const type = getDiffType ( diff )
7575 const prevDiff = index > 0 ? diffs [ index - 1 ] : null
7676 const nextDiff = index < diffs . length - 1 ? diffs [ index + 1 ] : null
77- const isModifiedLine = prevDiff && diff . count === 1 && prevDiff . count === 1 && type === 'added' && prevDiff . removed
78- const isUnuseLine = nextDiff && diff . count === 1 && nextDiff . count === 1 && type === 'removed' && nextDiff . added
77+ const isModifiedLine = prevDiff && diff . count === prevDiff . count && type === 'added' && prevDiff . removed
78+ const isUnuseLine = nextDiff && diff . count === nextDiff . count && type === 'removed' && nextDiff . added
7979
8080 if ( isUnuseLine ) return
8181
@@ -110,18 +110,6 @@ const renderUnified = (diffs: Array<Change>) => {
110110 const type = getDiffType ( diff )
111111 const prevDiff = index > 0 ? diffs [ index - 1 ] : null
112112 const nextDiff = index < diffs . length - 1 ? diffs [ index + 1 ] : null
113- const isModifiedPrevLine = nextDiff && diff . count === 1 && nextDiff . count === 1 && type === 'removed' && nextDiff . added
114- const isModifiedCurrentLine = prevDiff && diff . count === 1 && prevDiff . count === 1 && type === 'added' && prevDiff . removed
115-
116- if ( isModifiedPrevLine ) {
117- const diffWords = Diff . diffChars ( ( nextDiff as Change ) . value , diff . value )
118- diff . value = renderLine ( diffWords )
119- }
120-
121- if ( isModifiedCurrentLine ) {
122- const diffWords = Diff . diffChars ( ( prevDiff as Change ) . value , diff . value )
123- diff . value = renderLine ( diffWords )
124- }
125113
126114 diff . value . replace ( / \n $ / , '' ) . split ( '\n' ) . map ( ( value ) => {
127115 const skip = type === 'removed'
0 commit comments