Skip to content

Commit

Permalink
Merge pull request #249 from mattprecious/mattp/2025-02-17/with-style
Browse files Browse the repository at this point in the history
Remove our withStyle
  • Loading branch information
mattprecious authored Feb 17, 2025
2 parents 2d9479d + fe556a4 commit 1657e79
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.mattprecious.stacker.rendering

import com.jakewharton.mosaic.text.AnnotatedString
import com.jakewharton.mosaic.text.SpanStyle
import com.jakewharton.mosaic.text.withStyle
import com.jakewharton.mosaic.ui.Color
import com.jakewharton.mosaic.ui.TextStyle.Companion.Italic

Expand All @@ -21,12 +22,3 @@ fun AnnotatedString.Builder.branch(content: AnnotatedString.Builder.() -> Unit)
fun AnnotatedString.Builder.code(content: AnnotatedString.Builder.() -> Unit) {
withStyle(codeStyle, content)
}

private fun AnnotatedString.Builder.withStyle(
style: SpanStyle,
content: AnnotatedString.Builder.() -> Unit,
) {
pushStyle(style)
content()
pop()
}

0 comments on commit 1657e79

Please sign in to comment.