提交 8c1327af 编写于 作者: I isidor

fixes #76696

上级 7b463651
......@@ -69,13 +69,12 @@ export class ToggleOrSetOutputScrollLockAction extends Action {
private toDispose: IDisposable[] = [];
constructor(id: string, label: string,
@IOutputService private readonly outputService: IOutputService) {
constructor(id: string, label: string, @IOutputService private readonly outputService: IOutputService) {
super(id, label, 'output-action output-scroll-unlock');
this.toDispose.push(this.outputService.onActiveOutputChannel(channel => {
const activeChannel = this.outputService.getActiveChannel();
if (activeChannel) {
this.setClass(activeChannel.scrollLock);
this.setClassAndLabel(activeChannel.scrollLock);
}
}));
}
......@@ -90,17 +89,19 @@ export class ToggleOrSetOutputScrollLockAction extends Action {
else {
activeChannel.scrollLock = !activeChannel.scrollLock;
}
this.setClass(activeChannel.scrollLock);
this.setClassAndLabel(activeChannel.scrollLock);
}
return Promise.resolve(true);
}
private setClass(locked: boolean) {
private setClassAndLabel(locked: boolean) {
if (locked) {
this.class = 'output-action output-scroll-lock';
this.label = nls.localize('outputScrollOn', "Turn Auto Scrolling On");
} else {
this.class = 'output-action output-scroll-unlock';
this.label = nls.localize('outputScrollOff', "Turn Auto Scrolling Off");
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册