@@ -62,7 +62,7 @@ public open class ScrollSyncMarkdownBlockRenderer(
6262 // but using the wrapper in overloaded functions here to pass to AutoScrollableBlock
6363 val blocks = remember { mutableStateOf(block) }
6464 blocks.value = block
65- CompositionLocalProvider (localUniqueBlock provides blocks.value) {
65+ CompositionLocalProvider (LocalLocatableBlock provides blocks.value) {
6666 // Don't recompose unchanged blocks
6767 // val ogBlock = remember(block) { block.originalBlock }
6868 super .RenderBlock (block.originalBlock, enabled, onUrlClick, modifier)
@@ -86,7 +86,7 @@ public open class ScrollSyncMarkdownBlockRenderer(
8686 super .RenderParagraph (block, styling, enabled, onUrlClick, modifier)
8787 return
8888 }
89- val uniqueBlock = localUniqueBlock .current?.takeIf { it.originalBlock == block } ? : block
89+ val uniqueBlock = LocalLocatableBlock .current?.takeIf { it.originalBlock == block } ? : block
9090 AutoScrollableBlock (uniqueBlock, synchronizer) {
9191 super .RenderParagraph (block, styling, enabled, onUrlClick, modifier)
9292 }
@@ -106,7 +106,7 @@ public open class ScrollSyncMarkdownBlockRenderer(
106106 super .RenderHeading (block, styling, enabled, onUrlClick, modifier)
107107 return
108108 }
109- val uniqueBlock = localUniqueBlock .current?.takeIf { it.originalBlock == block } ? : block
109+ val uniqueBlock = LocalLocatableBlock .current?.takeIf { it.originalBlock == block } ? : block
110110 AutoScrollableBlock (uniqueBlock, synchronizer) {
111111 super .RenderHeading (block, styling, enabled, onUrlClick, modifier)
112112 }
@@ -136,7 +136,7 @@ public open class ScrollSyncMarkdownBlockRenderer(
136136 val content = block.content
137137 val highlightedCode by
138138 LocalCodeHighlighter .current.highlight(content, mimeType).collectAsState(AnnotatedString (content))
139- val uniqueBlock = localUniqueBlock .current?.takeIf { it.originalBlock == block } ? : block
139+ val uniqueBlock = LocalLocatableBlock .current?.takeIf { it.originalBlock == block } ? : block
140140 val actualBlock by rememberUpdatedState(uniqueBlock)
141141 AutoScrollableBlock (actualBlock, synchronizer) {
142142 Text (
@@ -166,7 +166,7 @@ public open class ScrollSyncMarkdownBlockRenderer(
166166 val content = block.content
167167 val highlightedCode by
168168 LocalCodeHighlighter .current.highlight(content, block.info).collectAsState(AnnotatedString (content))
169- val uniqueBlock = localUniqueBlock .current?.takeIf { it.originalBlock == block } ? : block
169+ val uniqueBlock = LocalLocatableBlock .current?.takeIf { it.originalBlock == block } ? : block
170170 val actualBlock by rememberUpdatedState(uniqueBlock)
171171 AutoScrollableBlock (actualBlock, synchronizer) {
172172 Text (
@@ -199,7 +199,7 @@ public open class ScrollSyncMarkdownBlockRenderer(
199199 .border(styling.borderWidth, styling.borderColor, styling.shape)
200200 .then(if (styling.fillWidth) Modifier .fillMaxWidth() else Modifier ),
201201 ) {
202- val uniqueBlock = localUniqueBlock .current?.takeIf { it.originalBlock == block } ? : block
202+ val uniqueBlock = LocalLocatableBlock .current?.takeIf { it.originalBlock == block } ? : block
203203 val actualBlock by rememberUpdatedState(uniqueBlock)
204204 AutoScrollableBlock (actualBlock, scrollingSynchronizer, Modifier .padding(styling.padding)) {
205205 Text (
@@ -217,7 +217,7 @@ public open class ScrollSyncMarkdownBlockRenderer(
217217 }
218218 }
219219
220- private val localUniqueBlock : ProvidableCompositionLocal <LocatableMarkdownBlock ?> = staticCompositionLocalOf {
220+ private val LocalLocatableBlock : ProvidableCompositionLocal <LocatableMarkdownBlock ?> = staticCompositionLocalOf {
221221 null
222222 }
223223}
0 commit comments