From f43f247b5c2fefa4482bd4cc7ff3ce7bc1c433df Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Tue, 24 Sep 2024 10:50:32 +0700 Subject: [PATCH] UBERF-8242 Fix scroll jumping in codeblock (#6695) Signed-off-by: Alexander Onnikov --- .../text-editor-resources/src/components/extension/codeblock.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {