提交 d3d95101 编写于 作者: I isidor

breakpointView: minor polish

上级 0c2de000
......@@ -60,7 +60,6 @@ export class BreakpointsView extends ViewsViewletPanel {
this.minimumBodySize = this.maximumBodySize = this.getExpandedBodySize();
this.settings = options.viewletSettings;
this.disposables.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange()));
this.disposables.push(this.debugService.getViewModel().onDidSelectFunctionBreakpoint(() => this.onBreakpointsChange()));
}
public renderBody(container: HTMLElement): void {
......@@ -89,6 +88,7 @@ export class BreakpointsView extends ViewsViewletPanel {
}
if (selectFunctionBreakpoint && element instanceof FunctionBreakpoint) {
this.debugService.getViewModel().setSelectedFunctionBreakpoint(element);
this.onBreakpointsChange();
}
};
this.disposables.push(this.list.onKeyUp(e => {
......@@ -104,7 +104,7 @@ export class BreakpointsView extends ViewsViewletPanel {
handleBreakpointFocus(true, false);
}));
this.list.splice(0, 0, this.elements);
this.list.splice(0, this.list.length, this.elements);
}
protected layoutBody(size: number): void {
......@@ -426,12 +426,12 @@ class FunctionBreakpointInputRenderer implements IRenderer<IFunctionBreakpoint,
const toDispose: IDisposable[] = [inputBox, styler];
const wrapUp = (renamed: boolean) => {
if (inputBox.value) {
this.debugService.getViewModel().setSelectedFunctionBreakpoint(undefined);
if (inputBox.value && (renamed || template.breakpoint.name)) {
this.debugService.renameFunctionBreakpoint(template.breakpoint.getId(), renamed ? inputBox.value : template.breakpoint.name).done(null, onUnexpectedError);
} else if (!template.breakpoint.name) {
} else {
this.debugService.removeFunctionBreakpoints(template.breakpoint.getId()).done(null, onUnexpectedError);
}
this.debugService.getViewModel().setSelectedFunctionBreakpoint(undefined);
};
toDispose.push(dom.addStandardDisposableListener(inputBox.inputElement, 'keydown', (e: IKeyboardEvent) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册