From a83fc0f3d1ca30f08e4f5b4564e7aa7db7c0e26e Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Thu, 19 Nov 2026 15:49:10 +0800 Subject: [PATCH] fix(editor): keep line-end annotations past the code with wrapped-part indent (#4463) With soft wrap and "Use original line's indent for wrapped parts", an indented line carries a negative text-indent. Inline widgets inherited it, so the inline blame (and other line-end hints drawn in a block box) started that many columns to the left, over the code. Widgets now reset text-indent. --- src/editor/core/cm/theme.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/editor/core/cm/theme.ts b/src/editor/core/cm/theme.ts index fb5639ed3..63f153d7c 100644 --- a/src/editor/core/cm/theme.ts +++ b/src/editor/core/cm/theme.ts @@ -420,4 +420,8 @@ export const openideaTheme = EditorView.theme({ "&.cm-lineWrapping .cm-line, .cm-lineWrapping .cm-line": { paddingRight: "calc(24px + var(--cm-corner-inset, 0px))", }, + // The wrapped-part indent is a negative `text-indent` on the line (prefs.ts). Widgets inherit + // it, and a block-level box inside one (the inline blame, a line-end hint) would start its + // text that many columns to the left, over the code. + ".cm-line [contenteditable='false']": { textIndent: "0" }, });