@@ -20,20 +20,21 @@ const DIFF_LINE_COLORS = {
2020const lineColor = (
2121 line : string ,
2222 themeName : 'dark' | 'light' ,
23+ mutedColor : string ,
2324) : { fg : string ; attrs ?: number } => {
2425 if ( line . startsWith ( '@@' ) ) {
2526 return { fg : 'cyan' , attrs : TextAttributes . BOLD }
2627 }
2728 if ( line . startsWith ( '+++' ) || line . startsWith ( '---' ) ) {
28- return { fg : 'gray' , attrs : TextAttributes . BOLD }
29+ return { fg : mutedColor , attrs : TextAttributes . BOLD }
2930 }
3031 if (
3132 line . startsWith ( 'diff ' ) ||
3233 line . startsWith ( 'index ' ) ||
3334 line . startsWith ( 'rename ' ) ||
3435 line . startsWith ( 'similarity ' )
3536 ) {
36- return { fg : 'gray' }
37+ return { fg : mutedColor }
3738 }
3839 if ( line . startsWith ( '+' ) ) {
3940 return { fg : DIFF_LINE_COLORS [ themeName ] . added }
@@ -42,7 +43,7 @@ const lineColor = (
4243 return { fg : DIFF_LINE_COLORS [ themeName ] . removed }
4344 }
4445 if ( line . startsWith ( '\\' ) ) {
45- return { fg : 'gray' }
46+ return { fg : mutedColor }
4647 }
4748 return { fg : '' }
4849}
@@ -59,7 +60,7 @@ export const DiffViewer = ({ diffText }: DiffViewerProps) => {
5960 . filter ( ( rawLine ) => ! rawLine . startsWith ( '@@' ) )
6061 . map ( ( rawLine , idx ) => {
6162 const line = rawLine . length === 0 ? ' ' : rawLine
62- const { fg, attrs } = lineColor ( line , theme . name )
63+ const { fg, attrs } = lineColor ( line , theme . name , theme . muted )
6364 const resolvedFg = fg || theme . foreground
6465 return (
6566 < text key = { `diff-line-${ idx } ` } style = { { wrapMode : 'none' } } >
0 commit comments