From a93f81c270798e2d37ec2c615f34eed6cd031790 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 15 Mar 2022 14:57:34 -0400 Subject: [PATCH 1/6] Update typings/xterm.d.ts Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> --- typings/xterm.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 0dce1ce6..0703021a 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -432,8 +432,8 @@ declare module 'xterm' { readonly onRender: IEvent; /** - * The HTMLElement that gets created or drawn to (for scrollbar decorations) - * after the first _onRender call, or undefined if accessed before + * The element that the decoration is rendered to. This will be undefined + * until it is rendered for the first time by @{link IDecoration.onRender}. * that. */ element: HTMLElement | undefined; From 8488f1ad6312c36c8f39307836d4782c522a8653 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 15 Mar 2022 14:59:09 -0400 Subject: [PATCH 2/6] Update src/browser/Decorations/OverviewRulerRenderer.ts Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> --- src/browser/Decorations/OverviewRulerRenderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/Decorations/OverviewRulerRenderer.ts b/src/browser/Decorations/OverviewRulerRenderer.ts index a9439d9f..87ec3589 100644 --- a/src/browser/Decorations/OverviewRulerRenderer.ts +++ b/src/browser/Decorations/OverviewRulerRenderer.ts @@ -73,7 +73,7 @@ export class OverviewRulerRenderer extends Disposable { } else { this._canvas.style.left = decoration.options.x ? `${decoration.options.x * this._renderService.dimensions.actualCellWidth}px` : ''; } - if (!decoration.options.overviewRulerOptions?.color) { + if (!decoration.options.overviewRulerOptions) { this._decorationElements.delete(decoration); return; } From 5b8777267a5566e7d52395e4008588241f2ee153 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 15 Mar 2022 14:59:17 -0400 Subject: [PATCH 3/6] Update typings/xterm.d.ts Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> --- typings/xterm.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 0703021a..193f2ab9 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -465,9 +465,7 @@ declare module 'xterm' { /** - * The width of the decoration in cells, which defaults to - * cell width or the width in pixels, when an overlayRulerItemColor - * is provided. + * The width of the decoration in cells, defaults to 1. */ width?: number; From 45ecc837e40740e3c01b0b787783d1380045c334 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 15 Mar 2022 14:59:23 -0400 Subject: [PATCH 4/6] Update typings/xterm.d.ts Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> --- typings/xterm.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 193f2ab9..05a1e786 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -470,8 +470,7 @@ declare module 'xterm' { width?: number; /** - * The height of the decoration in cells, which defaults to - * cell height + * The height of the decoration in cells, defaults to 1. */ height?: number; From b146ffd30f3a72652404dcefc221af456d1a93a2 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 15 Mar 2022 14:59:43 -0400 Subject: [PATCH 5/6] Update src/browser/Decorations/OverviewRulerRenderer.ts Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> --- src/browser/Decorations/OverviewRulerRenderer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/browser/Decorations/OverviewRulerRenderer.ts b/src/browser/Decorations/OverviewRulerRenderer.ts index 87ec3589..04d2cb47 100644 --- a/src/browser/Decorations/OverviewRulerRenderer.ts +++ b/src/browser/Decorations/OverviewRulerRenderer.ts @@ -79,7 +79,8 @@ export class OverviewRulerRenderer extends Disposable { } this._ctx.lineWidth = 1; this._ctx.strokeStyle = decoration.options.overviewRulerOptions.color; - const size = Math.floor(this._optionsService.options.overviewRulerWidth / 3); + const outerSize = Math.floor(this._optionsService.options.overviewRulerWidth / 3); + const innerSize = Math.ceil(this._optionsService.options.overviewRulerWidth / 3); const position = decoration.options.overviewRulerOptions.position; this._ctx.strokeRect( !position || position === 'left' ? 0 : position === 'right' ? size * 2 + 1: size, From fdc2bc49604280985bdf094905abab6421d59880 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 15 Mar 2022 14:59:48 -0400 Subject: [PATCH 6/6] Update typings/xterm.d.ts Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> --- typings/xterm.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 05a1e786..b7c89319 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -475,10 +475,11 @@ declare module 'xterm' { height?: number; /** - * Renders the decoration in the scrollbar - * with the given @param color and optional @param position. - * If @param position is not set, it will span the full @param overviewRulerWidth, which - * must be provided via @TerminalOptions for this to work. + * When defined, renders the decoration in the overview ruler to the right + * of the terminal. {@link ITerminalOptions.overviewRulerWidth} must be set + * in order to see the overview ruler. + * @param color The color of the decoration. + * @param position The position of the decoration. */ overviewRulerOptions?: { color: string; position?: 'left' | 'center' | 'right'} }