From ab8d8346ee241926a80f67d2e9e407402b992900 Mon Sep 17 00:00:00 2001 From: Thomas Seeley Date: Wed, 13 May 2026 10:16:06 -0400 Subject: [PATCH] send character width in editor metrics --- .../membrane/browser/membraneEditorMetrics.contribution.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/contrib/membrane/browser/membraneEditorMetrics.contribution.ts b/src/vs/workbench/contrib/membrane/browser/membraneEditorMetrics.contribution.ts index 64d33c07246a1..aa44b2d74d57a 100644 --- a/src/vs/workbench/contrib/membrane/browser/membraneEditorMetrics.contribution.ts +++ b/src/vs/workbench/contrib/membrane/browser/membraneEditorMetrics.contribution.ts @@ -8,6 +8,7 @@ import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase import { IEditorService } from '../../../services/editor/common/editorService.js'; import { isCodeEditor, ICodeEditor } from '../../../../editor/browser/editorBrowser.js'; import { mainWindow } from '../../../../base/browser/window.js'; +import { EditorOption } from '../../../../editor/common/config/editorOptions.js'; export class MembraneEditorMetricsContribution extends Disposable implements IWorkbenchContribution { @@ -140,6 +141,8 @@ export class MembraneEditorMetricsContribution extends Disposable implements IWo }; } + const fontInfo = editor.getOption(EditorOption.fontInfo); + return { uri: model.uri.toString(), scrollTop: editor.getScrollTop(), @@ -149,6 +152,7 @@ export class MembraneEditorMetricsContribution extends Disposable implements IWo lastVisibleLine, contentLeft: layoutInfo.contentLeft, contentWidth: layoutInfo.contentWidth, + charWidth: fontInfo.typicalHalfwidthCharacterWidth, lineCount, linePositions, ...(selectionData && { selection: selectionData }),