Improve notebook editor height calculations (#3966)

* Improve notebook editor height calculations

* PR comments, hook up to onDidChangeConfiguration
This commit is contained in:
Chris LaFreniere
2019-02-07 14:09:09 -10:00
committed by GitHub
parent d9079fe18e
commit 9ce9a1598f
2 changed files with 33 additions and 5 deletions

View File

@@ -30,6 +30,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export const CODE_SELECTOR: string = 'code-component';
@@ -83,6 +84,7 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
@Inject(IContextMenuService) private contextMenuService: IContextMenuService,
@Inject(IContextViewService) private contextViewService: IContextViewService,
@Inject(INotificationService) private notificationService: INotificationService,
@Inject(IConfigurationService) private _configurationService: IConfigurationService
) {
super();
this._cellToggleMoreActions = this._instantiationService.createInstance(CellToggleMoreActions);
@@ -149,6 +151,11 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
this.cellModel.source = this._editorModel.getValue();
this.onContentChanged.emit();
}));
this._register(this._configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('editor.wordWrap')) {
this._editor.setHeightToScrollHeight(true);
}
}));
this._register(this.model.layoutChanged(this.layout, this));
this.layout();
}