Skip to content

Commit 224ae7c

Browse files
authored
Merge pull request microsoft#186447 from microsoft/merogge/editor-bug
check if config exists before writing to it
2 parents b114662 + ac0a637 commit 224ae7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/accessibility/browser/accessibleView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class AccessibleView extends Disposable {
107107
const settingKey = `accessibility.verbosity.${provider.id}`;
108108
const value = this._configurationService.getValue(settingKey);
109109
const readMoreLink = provider.options.readMoreUrl ? localize("openDoc", "\nPress H now to open a browser window with more information related to accessibility.\n") : '';
110-
const disableHelpHint = provider.options.type && value ? localize('disable-help-hint', '\nTo disable the `accessibility.verbosity` hint for this feature, press D now.\n') : '\n';
110+
const disableHelpHint = provider.options.type === AccessibleViewType.HelpMenu && !!value ? localize('disable-help-hint', '\nTo disable the `accessibility.verbosity` hint for this feature, press D now.\n') : '\n';
111111
const fragment = provider.provideContent() + readMoreLink + disableHelpHint + localize('exit-tip', 'Exit this menu via the Escape key.');
112112

113113
this._getTextModel(URI.from({ path: `accessible-view-${provider.id}`, scheme: 'accessible-view', fragment })).then((model) => {
@@ -126,7 +126,7 @@ class AccessibleView extends Disposable {
126126
this._register(this._editorWidget.onKeyUp((e) => {
127127
if (e.keyCode === KeyCode.Escape) {
128128
this._contextViewService.hideContextView();
129-
} else if (e.keyCode === KeyCode.KeyD) {
129+
} else if (e.keyCode === KeyCode.KeyD && this._configurationService.getValue(settingKey)) {
130130
this._configurationService.updateValue(settingKey, false);
131131
} else if (e.keyCode === KeyCode.KeyH && provider.options.readMoreUrl) {
132132
const url: string = provider.options.readMoreUrl!;

0 commit comments

Comments
 (0)