@@ -117,19 +117,19 @@ type cachedStyles struct {
117117 styleCodeBg lipgloss.Style // kept only because chroma styles inherit its bg color
118118
119119 // ANSI styles (for fast inline rendering)
120- ansiBold ansiStyle
121- ansiItalic ansiStyle
122- ansiBoldItal ansiStyle
123- ansiStrike ansiStyle
124- ansiCode ansiStyle
125- ansiLink ansiStyle
126- ansiLinkText ansiStyle
127- ansiText ansiStyle // base document text style
128- ansiHeadings [6 ]ansiStyle // heading styles for inline restoration
129- ansiBlockquote ansiStyle // blockquote style for inline restoration
130- ansiFootnote ansiStyle // footnote reference style
131- ansiCodeBg ansiStyle // code block background (cached to avoid repeated buildAnsiStyle)
132- ansiCodeBgMuted ansiStyle // muted foreground on code block background ( for code -block chrome like copy label)
120+ ansiBold ansiStyle
121+ ansiItalic ansiStyle
122+ ansiBoldItal ansiStyle
123+ ansiStrike ansiStyle
124+ ansiCode ansiStyle
125+ ansiLink ansiStyle
126+ ansiLinkText ansiStyle
127+ ansiText ansiStyle // base document text style
128+ ansiHeadings [6 ]ansiStyle // heading styles for inline restoration
129+ ansiBlockquote ansiStyle // blockquote style for inline restoration
130+ ansiFootnote ansiStyle // footnote reference style
131+ ansiCodeBg ansiStyle // code block background (cached to avoid repeated buildAnsiStyle)
132+ ansiCodeBlockCopyIcon ansiStyle // muted foreground on code block background, used for the per -block copy icon
133133
134134 // Pre-rendered chrome (computed once, reused across renders)
135135 headingPrefixes [6 ]string // raw prefix strings (e.g. "## ") for width math
@@ -243,7 +243,7 @@ func getGlobalStyles() *cachedStyles {
243243 ansiBlockquote : buildAnsiStyle (blockquoteLipStyle ),
244244 ansiFootnote : buildAnsiStyle (lipgloss .NewStyle ().Foreground (styles .TextSecondary ).Italic (true )),
245245 ansiCodeBg : buildAnsiStyle (codeBg ),
246- ansiCodeBgMuted : buildAnsiStyle (codeBg .Foreground (styles .TextMutedGray )),
246+ ansiCodeBlockCopyIcon : buildAnsiStyle (codeBg .Foreground (styles .TextMutedGray )),
247247 headingPrefixes : headingPrefixes ,
248248 styledHeadingPrefixes : styledPrefixes ,
249249 styledHeadingContIndent : styledContIndents ,
@@ -1936,16 +1936,16 @@ func (p *parser) renderCodeBlockWithIndent(code, lang, indent string, availableW
19361936 // back to this block's raw content.
19371937 topLine := strings .Count (p .out .String (), "\n " )
19381938 p .out .WriteString (indent )
1939- labelWidth := runewidth .StringWidth (CodeBlockCopyLabel )
1940- leftFill := max (availableWidth - paddingRight - labelWidth , 0 )
1941- if availableWidth >= labelWidth + paddingRight {
1939+ iconWidth := runewidth .StringWidth (CodeBlockCopyIcon )
1940+ leftFill := max (availableWidth - paddingRight - iconWidth , 0 )
1941+ if availableWidth >= iconWidth + paddingRight {
19421942 bgStyle .renderTo (& p .out , spaces (leftFill ))
1943- p .styles .ansiCodeBgMuted .renderTo (& p .out , CodeBlockCopyLabel )
1943+ p .styles .ansiCodeBlockCopyIcon .renderTo (& p .out , CodeBlockCopyIcon )
19441944 if paddingRight > 0 {
19451945 bgStyle .renderTo (& p .out , spaces (paddingRight ))
19461946 }
19471947 } else {
1948- // Too narrow for the label ; fall back to a plain top padding row.
1948+ // Too narrow for the icon ; fall back to a plain top padding row.
19491949 bgStyle .renderTo (& p .out , fullWidthPad )
19501950 }
19511951 p .out .WriteByte ('\n' )
0 commit comments