Skip to content

Commit 919c4c1

Browse files
committed
fix: shiki highlight jumping
Signed-off-by: Innei <[email protected]>
1 parent 03bc7b1 commit 919c4c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/ui/code-highlighter/shiki/ShikiWrapper.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const ShikiHighLighterWrapper = forwardRef<
6767
$hightlighted,
6868
)
6969

70-
$el.scrollTop = lineHeight * childIndexInParent - 30
70+
$el.scrollTop = lineHeight * childIndexInParent - $el.clientHeight / 2
7171
}
7272
} else {
7373
setIsOverflow(false)

0 commit comments

Comments
 (0)