@@ -20,6 +20,7 @@ const DiffUnifiedOldLine = ({
2020 width,
2121 theme,
2222 height,
23+ columns,
2324 rawLine,
2425 diffLine,
2526 plainLine,
@@ -33,6 +34,7 @@ const DiffUnifiedOldLine = ({
3334 width : number ;
3435 height : number ;
3536 theme : "light" | "dark" ;
37+ columns : number ;
3638 rawLine : string ;
3739 lineNumber : number ;
3840 plainLine ?: File [ "plainFile" ] [ number ] ;
@@ -45,7 +47,7 @@ const DiffUnifiedOldLine = ({
4547 const color = theme === "light" ? diffPlainLineNumberColor . light : diffPlainLineNumberColor . dark ;
4648 const bg = theme === "light" ? diffDelLineNumber . light : diffDelLineNumber . dark ;
4749 return (
48- < Box data-line = { index } data-state = "diff" height = { height } >
50+ < Box data-line = { index } data-state = "diff" height = { height } width = { columns } >
4951 < Box width = { width * 2 + 2 } flexShrink = { 0 } >
5052 < Box width = { width } justifyContent = "flex-end" >
5153 < Text color = { color } wrap = "wrap" backgroundColor = { bg } data-line-old-num = { lineNumber } >
@@ -91,6 +93,7 @@ const DiffUnifiedNewLine = ({
9193 width,
9294 theme,
9395 height,
96+ columns,
9497 rawLine,
9598 diffLine,
9699 plainLine,
@@ -104,6 +107,7 @@ const DiffUnifiedNewLine = ({
104107 width : number ;
105108 height : number ;
106109 theme : "light" | "dark" ;
110+ columns : number ;
107111 rawLine : string ;
108112 lineNumber : number ;
109113 plainLine ?: File [ "plainFile" ] [ number ] ;
@@ -116,7 +120,7 @@ const DiffUnifiedNewLine = ({
116120 const color = theme === "light" ? diffPlainLineNumberColor . light : diffPlainLineNumberColor . dark ;
117121 const bg = theme === "light" ? diffAddLineNumber . light : diffAddLineNumber . dark ;
118122 return (
119- < Box data-line = { index } data-state = "diff" height = { height } >
123+ < Box data-line = { index } data-state = "diff" height = { height } width = { columns } >
120124 < Box width = { width * 2 + 2 } flexShrink = { 0 } >
121125 < Box width = { width } >
122126 < Text backgroundColor = { bg } wrap = "wrap" >
@@ -201,14 +205,11 @@ const _DiffUnifiedLine = memo(
201205 ? diffFile . getOldPlainLine ( oldLinenumber )
202206 : undefined ;
203207
204- const contentWidth = columns - ( width + 1 ) * 2 - 1 ;
208+ const contentWidth = columns - ( width + 1 ) * 2 ;
205209
206210 let row = getCurrentLineRow ( { content : rawLine , width : contentWidth } ) ;
207211
208- row =
209- diffLine ?. changes ?. hasLineChange && diffLine . changes . newLineSymbol === NewLineSymbol . NEWLINE
210- ? row + 1
211- : row ;
212+ row = diffLine ?. changes ?. hasLineChange && diffLine . changes . newLineSymbol === NewLineSymbol . NEWLINE ? row + 1 : row ;
212213
213214 const color = hasDiff
214215 ? theme === "light"
@@ -233,6 +234,7 @@ const _DiffUnifiedLine = memo(
233234 theme = { theme }
234235 width = { width }
235236 height = { row }
237+ columns = { columns }
236238 rawLine = { rawLine }
237239 diffFile = { diffFile }
238240 index = { lineNumber }
@@ -250,6 +252,7 @@ const _DiffUnifiedLine = memo(
250252 theme = { theme }
251253 width = { width }
252254 height = { row }
255+ columns = { columns }
253256 rawLine = { rawLine }
254257 index = { lineNumber }
255258 diffLine = { diffLine }
0 commit comments