diff --git a/plugins/text-editor-resources/src/components/extension/codeblock.ts b/plugins/text-editor-resources/src/components/extension/codeblock.ts index 43d3c8dc0a..e7fb284c08 100644 --- a/plugins/text-editor-resources/src/components/extension/codeblock.ts +++ b/plugins/text-editor-resources/src/components/extension/codeblock.ts @@ -134,7 +134,7 @@ function createDecorations (doc: ProseMirrorNode, options: CodeBlockLowlightOpti doc.descendants((node, pos) => { if (node.type.name === CodeBlockLowlight.name) { decorations.push( - Decoration.widget(pos + node.nodeSize - 1, (view) => { + Decoration.widget(pos + 1, (view) => { const button = createLangButton(node.attrs.language) if (view.editable) {