diff --git a/README.md b/README.md index c80dd61..00a6a30 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Table of contributed settings (prefix "errorLens."): |infoGutterIconColor|`"#00b7e4"`|Info color of the `circle` gutter icon set.| |followCursor|`"allLines"`|Highlight only portion of the problems. Possible values: `"allLines"`, `"activeLine"`, `"closestProblem"`.| |followCursorMore|**`0`**|Augments `followCursor`. Adds number of lines to top and bottom when `followCursor` is `activeLine`. Adds number of closest problems when `followCursor` is `closestProblem`| +|scrollbarHackEnabled|**`false`**|When enabled - prevents showing horizontal scrollbar for decorations. (Might have a conflict with `errorLens.fontFamily` or `errorLens.padding` settings).| ## Commands diff --git a/package.json b/package.json index a2e0f6f..4e2e547 100644 --- a/package.json +++ b/package.json @@ -318,6 +318,11 @@ "type": "string" }, "markdownDescription": "Exclude files by using glob pattern." + }, + "errorLens.scrollbarHackEnabled": { + "type": "boolean", + "default": false, + "markdownDescription": "When enabled - prevents showing horizontal scrollbar for decorations. (Might have a conflict with `errorLens.fontFamily` or `errorLens.padding` settings)." } } }, diff --git a/src/decorations.ts b/src/decorations.ts index d8086ed..ef6dd9e 100644 --- a/src/decorations.ts +++ b/src/decorations.ts @@ -66,15 +66,16 @@ export function setDecorationStyle(): void { const onlyDigitsRegExp = /^\d+$/; const fontFamily = extensionConfig.fontFamily ? `font-family:${extensionConfig.fontFamily}` : ''; - const fontSize = extensionConfig.fontSize ? `font-size:${onlyDigitsRegExp.test(extensionConfig.fontSize) ? `${extensionConfig.fontSize}px` : extensionConfig.fontSize};line-height:1` : ''; + const fontSize = extensionConfig.fontSize ? `font-size:${onlyDigitsRegExp.test(extensionConfig.fontSize) ? `${extensionConfig.fontSize}px` : extensionConfig.fontSize}` : ''; const padding = extensionConfig.padding ? `padding:${onlyDigitsRegExp.test(extensionConfig.padding) ? `${extensionConfig.padding}px` : extensionConfig.padding}` : ''; const margin = `margin-left:${onlyDigitsRegExp.test(extensionConfig.margin) ? `${extensionConfig.margin}px` : extensionConfig.margin}`; const borderRadius = `border-radius: ${extensionConfig.borderRadius || '0'}`; + const scrollbarHack = extensionConfig.scrollbarHackEnabled ? 'position:absolute' : ''; const afterProps: vscode.ThemableDecorationAttachmentRenderOptions = { fontStyle: extensionConfig.fontStyleItalic ? 'italic' : 'normal', fontWeight: extensionConfig.fontWeight, - textDecoration: `;${fontFamily};${fontSize};${padding};${margin};${borderRadius};`, + textDecoration: `none;${fontFamily};${fontSize};${padding};${margin};${borderRadius};${scrollbarHack}`, }; Global.decorationRenderOptionsError = { diff --git a/src/types.ts b/src/types.ts index 945b5b4..935fdce 100644 --- a/src/types.ts +++ b/src/types.ts @@ -70,6 +70,10 @@ export interface ExtensionConfig { * Update decorations only on save */ onSave: boolean; + /** + * Prevent scrollbars from appearing for decorations. + */ + scrollbarHackEnabled: boolean; gutterIconsEnabled: boolean; gutterIconsFollowCursorOverride: boolean;