提交 2308643f 编写于 作者: A Alex Dima

Fixes #41357

上级 b8e4e03b
......@@ -10,6 +10,7 @@ import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/
import { TabFocus } from 'vs/editor/common/config/commonEditorConfig';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { alert } from 'vs/base/browser/ui/aria/aria';
export class ToggleTabFocusModeAction extends EditorAction {
......@@ -31,8 +32,14 @@ export class ToggleTabFocusModeAction extends EditorAction {
}
public run(accessor: ServicesAccessor, editor: ICodeEditor): void {
let oldValue = TabFocus.getTabFocusMode();
TabFocus.setTabFocusMode(!oldValue);
const oldValue = TabFocus.getTabFocusMode();
const newValue = !oldValue;
TabFocus.setTabFocusMode(newValue);
if (newValue) {
alert(nls.localize('toggle.tabMovesFocus.on', "Pressing Tab will now move focus to the next focusable element"));
} else {
alert(nls.localize('toggle.tabMovesFocus.off', "Pressing Tab will now insert the tab character"));
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册