mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-08 06:49:37 +01:00
set tab focus when editable widget focused
This commit is contained in:
@@ -44,6 +44,7 @@ import { MenuPreventer } from 'vs/workbench/contrib/codeEditor/browser/menuPreve
|
||||
import { SelectionClipboardContributionID } from 'vs/workbench/contrib/codeEditor/browser/selectionClipboard';
|
||||
import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
||||
import { IMarkdownVulnerability } from '../common/annotations';
|
||||
import { TabFocus } from 'vs/editor/browser/config/tabFocus';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
@@ -334,6 +335,10 @@ export class CodeBlockPart extends Disposable {
|
||||
await this.updateEditor(data);
|
||||
|
||||
this.layout(width);
|
||||
if (editable) {
|
||||
this._register(this.editor.onDidFocusEditorWidget(() => TabFocus.setTabFocusMode(true)));
|
||||
this._register(this.editor.onDidBlurEditorWidget(() => TabFocus.setTabFocusMode(false)));
|
||||
}
|
||||
this.editor.updateOptions({ ariaLabel: localize('chat.codeBlockLabel', "Code block {0}", data.codeBlockIndex + 1), readOnly: !editable });
|
||||
|
||||
if (data.hideToolbar) {
|
||||
|
||||
Reference in New Issue
Block a user