vscode-error-lens icon indicating copy to clipboard operation
vscode-error-lens copied to clipboard

bug: custom fontSize + alignMessage causes alignment to break

Open lrstanley opened this issue 6 months ago • 5 comments

Using the following config:

{
    "errorLens.scrollbarHackEnabled": true,
    "errorLens.enabledDiagnosticLevels": [
        "error",
        "warning"
    ],
    "errorLens.onSave": true,
    "errorLens.fontSize": "-3px",
    "errorLens.alignMessage": {
        "start": 105,
        "end": 0,
        "padding": [
            0,
            1
        ]
    }
}

Causes start alignment to no longer work:

Suspect that the alignment calculation is using the relative font size for the error lens message itself, rather than the editor's font size, thus the skew.

Notes:

  • Yes, the above screenshot is using a monospace font (Comic Sans Mono).
  • The more I lower the font size (relative in my case, so more negative), the more the alignment breaks.
  • The shorter the line that the error is on (characters), the more left it shifts.
  • Removing errorLens.fontSize, and the alignment is functional again.

Not that big of a deal, as I'm not decreasing font size by much, so I will just disable that setting.

lrstanley avatar May 17 '25 20:05 lrstanley