Fix kernel name check bug, double-event hooking, and other Notebook issues (#4016)

* Fix error where kernel name was compared to itself. This doesn't break anything right now since we happen to have special handling of Python3, and for other kernels they share the same set of supported providers (which is what the check is used for). However it needs fixing for next release.
* Fix console error due to queryTextEditor trying to access model before it's ready
* Fix issues where notebook model hooked to session events multiple times
* Removed calls that weren't needed such as loadActiveContexts (if undefined, does nothing) and passing connection to initialize method
This commit is contained in:
Kevin Cunnane
2019-02-12 14:26:22 -08:00
committed by GitHub
parent 7ef2d52efd
commit 0aa71b5237
4 changed files with 17 additions and 16 deletions

View File

@@ -131,6 +131,10 @@ export class QueryTextEditor extends BaseTextEditor {
this._scrollbarHeight = this._config.editor.viewInfo.scrollbar.horizontalScrollbarSize;
}
let editorWidgetModel = editorWidget.getModel();
if (!editorWidgetModel) {
// Not ready yet
return;
}
let lineCount = editorWidgetModel.getLineCount();
// Need to also keep track of lines that wrap; if we just keep into account line count, then the editor's height would not be
// tall enough and we would need to show a scrollbar. Unfortunately, it looks like there isn't any metadata saved in a ICodeEditor