@@ -93,44 +93,31 @@ const DiffString = ({
9393 data-range-start = { range . location }
9494 data-range-end = { range . location + range . length }
9595 flexWrap = "wrap"
96+ backgroundColor = { bg }
9697 >
9798 { str1 . split ( "" ) . map ( ( char , index ) => (
98- < Text key = { index } backgroundColor = { bg } >
99- { char }
100- </ Text >
99+ < Text key = { index } > { char } </ Text >
101100 ) ) }
102101 { str2 . split ( "" ) . map ( ( char , index ) => (
103102 < Text key = { index } backgroundColor = { highlightBG } >
104103 { char }
105104 </ Text >
106105 ) ) }
107106 { str3 . split ( "" ) . map ( ( char , index ) => (
108- < Text key = { index } backgroundColor = { bg } >
109- { char }
110- </ Text >
107+ < Text key = { index } > { char } </ Text >
111108 ) ) }
112- { ""
113- . padStart ( height * width - rawLine . length )
114- . split ( "" )
115- . map ( ( char , index ) => (
116- < Text key = { char + "-" + index } backgroundColor = { bg } >
117- { char }
118- </ Text >
119- ) ) }
120109 </ Box >
121110 { isNewLineSymbolChanged === NewLineSymbol . NEWLINE && (
122- < Box width = { width - 1 } >
123- < Text backgroundColor = { bg } wrap = "truncate" >
124- { "\\ No newline at end of file" . padEnd ( width ) }
125- </ Text >
111+ < Box width = { width - 1 } backgroundColor = { bg } >
112+ < Text wrap = "truncate" > { "\\ No newline at end of file" . padEnd ( width ) } </ Text >
126113 </ Box >
127114 ) }
128115 </ >
129116 ) ;
130117 }
131118
132119 return (
133- < Box width = { width - 1 } flexWrap = "wrap" >
120+ < Box width = { width - 1 } flexWrap = "wrap" backgroundColor = { bg } >
134121 { rawLine
135122 . padEnd ( width * height )
136123 . split ( "" )
@@ -190,6 +177,7 @@ const DiffSyntax = ({
190177 data-range-start = { range . location }
191178 data-range-end = { range . location + range . length }
192179 flexWrap = "wrap"
180+ backgroundColor = { bg }
193181 >
194182 { syntaxLine . nodeList ?. map ( ( { node, wrapper } , index ) => {
195183 const lowlightStyles = getStyleFromClassName ( wrapper ?. properties ?. className ?. join ( " " ) || "" ) ;
@@ -200,7 +188,7 @@ const DiffSyntax = ({
200188 return (
201189 < React . Fragment key = { index } >
202190 { node . value . split ( "" ) . map ( ( char , index ) => (
203- < Text key = { index } backgroundColor = { bg } { ...lowlightStyle } { ...shikiStyle } >
191+ < Text key = { index } { ...lowlightStyle } { ...shikiStyle } >
204192 { char }
205193 </ Text >
206194 ) ) }
@@ -223,7 +211,7 @@ const DiffSyntax = ({
223211 return (
224212 < React . Fragment key = { index } >
225213 { str1 . split ( "" ) . map ( ( char , index ) => (
226- < Text key = { index } backgroundColor = { bg } { ...lowlightStyle } { ...shikiStyle } >
214+ < Text key = { index } { ...lowlightStyle } { ...shikiStyle } >
227215 { char }
228216 </ Text >
229217 ) ) }
@@ -233,36 +221,26 @@ const DiffSyntax = ({
233221 </ Text >
234222 ) ) }
235223 { str3 . split ( "" ) . map ( ( char , index ) => (
236- < Text key = { index } backgroundColor = { bg } { ...lowlightStyle } { ...shikiStyle } >
224+ < Text key = { index } { ...lowlightStyle } { ...shikiStyle } >
237225 { char }
238226 </ Text >
239227 ) ) }
240228 </ React . Fragment >
241229 ) ;
242230 }
243231 } ) }
244- { " "
245- . padEnd ( height * width - rawLine . length )
246- . split ( "" )
247- . map ( ( char , index ) => (
248- < Text key = { char + "-" + index } backgroundColor = { bg } >
249- { char }
250- </ Text >
251- ) ) }
252232 </ Box >
253233 { isNewLineSymbolChanged === NewLineSymbol . NEWLINE && (
254- < Box width = { width - 1 } >
255- < Text backgroundColor = { bg } wrap = "truncate" >
256- { "\\ No newline at end of file" . padEnd ( width ) }
257- </ Text >
234+ < Box width = { width - 1 } backgroundColor = { bg } >
235+ < Text wrap = "truncate" > { "\\ No newline at end of file" . padEnd ( width ) } </ Text >
258236 </ Box >
259237 ) }
260238 </ >
261239 ) ;
262240 }
263241
264242 return (
265- < Box width = { width - 1 } flexWrap = "wrap" >
243+ < Box width = { width - 1 } flexWrap = "wrap" backgroundColor = { bg } >
266244 { syntaxLine ?. nodeList ?. map ( ( { node, wrapper } , index ) => {
267245 const lowlightStyles = getStyleFromClassName ( wrapper ?. properties ?. className ?. join ( " " ) || "" ) ;
268246 const lowlightStyle = theme === "dark" ? lowlightStyles . dark : lowlightStyles . light ;
@@ -271,21 +249,13 @@ const DiffSyntax = ({
271249 return (
272250 < React . Fragment key = { index } >
273251 { node . value . split ( "" ) . map ( ( char , index ) => (
274- < Text key = { index } backgroundColor = { bg } { ...lowlightStyle } { ...shikiStyle } >
252+ < Text key = { index } { ...lowlightStyle } { ...shikiStyle } >
275253 { char }
276254 </ Text >
277255 ) ) }
278256 </ React . Fragment >
279257 ) ;
280258 } ) }
281- { " "
282- . padEnd ( height * width - rawLine . length )
283- . split ( "" )
284- . map ( ( char , index ) => (
285- < Text key = { index } backgroundColor = { bg } >
286- { char }
287- </ Text >
288- ) ) }
289259 </ Box >
290260 ) ;
291261} ;
0 commit comments