From 648287fa8532704f7a741dacffec3a66d8f97db8 Mon Sep 17 00:00:00 2001 From: Maddy <12754347+MaddyDev@users.noreply.github.com> Date: Wed, 29 Jan 2020 16:55:59 -0800 Subject: [PATCH] listen to command a and select the active element. (#8969) * listen to command a and select the active element. * type fix --- .../notebook/browser/cellViews/textCell.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts index 9b222c69b1..7d7c8c92a1 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts @@ -68,6 +68,14 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { this._model.updateActiveCell(undefined); } + @HostListener('document:keydown.meta.a', ['$event']) + onkeydown(e) { + // use preventDefault() to avoid invoking the editor's select all + // select the active . + e.preventDefault(); + document.execCommand('selectAll'); + } + private _content: string | string[]; private _lastTrustedMode: boolean; private isEditMode: boolean;