提交 3bf9deb1 编写于 作者: P Peng Lyu

support submit comment keybinding

上级 c69c1719
......@@ -14,6 +14,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
export class CommentFormActions implements IDisposable {
private _buttonElements: HTMLElement[] = [];
private readonly _toDispose = new DisposableStore();
private _actions: IAction[];
constructor(
private container: HTMLElement,
......@@ -30,6 +31,7 @@ export class CommentFormActions implements IDisposable {
for (const group of groups) {
const [, actions] = group;
this._actions = actions;
actions.forEach(action => {
const button = new Button(this.container);
this._buttonElements.push(button.element);
......@@ -44,6 +46,16 @@ export class CommentFormActions implements IDisposable {
}
}
triggerDefaultAction() {
if (this._actions.length) {
let lastAction = this._actions[0];
if (lastAction.enabled) {
this.actionHandler(lastAction);
}
}
}
dispose() {
this._toDispose.dispose();
}
......
......@@ -826,6 +826,8 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
await this.commandService.executeCommand(commandId, ...args);
return;
} else if (this._commentFormActions) {
this._commentFormActions.triggerDefaultAction();
}
} else {
this.createComment();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册