From 04cdd03b5d50f9ea1a84e907494a7cee57e53fc6 Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Fri, 10 Apr 2020 15:44:29 -0700 Subject: [PATCH 1/2] Fix monaco editor scrolling and line height --- .../react-common/monacoEditor.tsx | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/datascience-ui/react-common/monacoEditor.tsx b/src/datascience-ui/react-common/monacoEditor.tsx index 7d00912ab025..2f4c119103ea 100644 --- a/src/datascience-ui/react-common/monacoEditor.tsx +++ b/src/datascience-ui/react-common/monacoEditor.tsx @@ -188,8 +188,11 @@ export class MonacoEditor extends React.Component { this.windowResized(); - // Also recompute our visible line heights + // Recompute visible line tops this.debouncedComputeLineTops(); + + // A layout change may be because of a new line + this.throttledScrollCurrentPosition(editor); }) ); @@ -243,7 +246,9 @@ export class MonacoEditor extends React.Component { this.throttledUpdateWidgetPosition(); - this.throttledScrollCurrentPosition(editor); + + // Do this after the cursor changes so the text has time to appear + setTimeout(() => this.throttledScrollCurrentPosition(editor), 0); }) ); @@ -643,14 +648,12 @@ export class MonacoEditor extends React.Component Date: Fri, 10 Apr 2020 15:45:34 -0700 Subject: [PATCH 2/2] Add news entry --- news/2 Fixes/10952.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2 Fixes/10952.md diff --git a/news/2 Fixes/10952.md b/news/2 Fixes/10952.md new file mode 100644 index 000000000000..ad13a0db7e7b --- /dev/null +++ b/news/2 Fixes/10952.md @@ -0,0 +1 @@ +Scrolling in cells doesn't happen on new line. \ No newline at end of file