From f6a4cc93deb10cd7ef7f6cb7805c1d51daa414d5 Mon Sep 17 00:00:00 2001 From: Thomas Seeley Date: Sun, 11 Jan 2026 21:16:23 -0500 Subject: [PATCH] add styled arg to control if a view zone is styled or not, add contentLeft for codelens button positioning to scrollInfo command --- src/vs/code/browser/workbench/workbench.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts index 9e1d6942f4b7d..e471da5a50413 100644 --- a/src/vs/code/browser/workbench/workbench.ts +++ b/src/vs/code/browser/workbench/workbench.ts @@ -159,7 +159,6 @@ type Writeable = { -readonly [P in keyof T]: T[P] }; const domElement = window.vscodeTargetContainer || document.body; create(domElement, config); - // NOTE: Registering these commands here ... CommandsRegistry.registerCommand( 'membrane.setViewZones', async ( @@ -170,6 +169,7 @@ type Writeable = { -readonly [P in keyof T]: T[P] }; afterLineNumber: number; heightInPx: number; lines: string[]; + styled?: boolean; }>; }, ) => { @@ -206,7 +206,9 @@ type Writeable = { -readonly [P in keyof T]: T[P] }; // Add all new zones const newZoneIds: string[] = []; for (const zone of args.zones) { - const container = document.createElement('div'); + const container = document.createElement('div'); + + if (zone.styled) { container.style.cssText = ` position: relative; background: rgba(255, 0, 0, 0.15); @@ -230,6 +232,7 @@ type Writeable = { -readonly [P in keyof T]: T[P] }; lineDiv.textContent = line; container.appendChild(lineDiv); }); + } const zoneId = accessor.addZone({ afterLineNumber: zone.afterLineNumber, @@ -260,6 +263,7 @@ type Writeable = { -readonly [P in keyof T]: T[P] }; scrollTop: activeControl.getScrollTop(), firstLineTop: activeControl.getTopForLineNumber(firstVisibleLine), firstVisibleLine: firstVisibleLine, + contentLeft: activeControl.getLayoutInfo().contentLeft, }; }, );