From 016506b5928040050d909e14d1e6a94efe0c3c11 Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Thu, 14 Nov 2019 09:36:11 -0800 Subject: [PATCH] After pasting code, arrow keys don't navigate in a cell. --- news/2 Fixes/8495.md | 1 + src/datascience-ui/react-common/monacoEditor.tsx | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 news/2 Fixes/8495.md diff --git a/news/2 Fixes/8495.md b/news/2 Fixes/8495.md new file mode 100644 index 000000000000..d4d86a50faf2 --- /dev/null +++ b/news/2 Fixes/8495.md @@ -0,0 +1 @@ +After pasting code, arrow keys don't navigate in a cell. diff --git a/src/datascience-ui/react-common/monacoEditor.tsx b/src/datascience-ui/react-common/monacoEditor.tsx index 6d2a916bcc55..9625f6cc399a 100644 --- a/src/datascience-ui/react-common/monacoEditor.tsx +++ b/src/datascience-ui/react-common/monacoEditor.tsx @@ -312,9 +312,9 @@ export class MonacoEditor extends React.Component { const match = l.style.top ? /(.+)px/.exec(l.style.top) : null; return match ? parseInt(match[0], 10) : Infinity; - }); + }).sort((a, b) => a - b); return this.lineTops; } @@ -352,7 +354,6 @@ export class MonacoEditor extends React.Component= 0) { - window.console.log(`Scrolling to line ${current}`); visibleLineDivs[current].scrollIntoView({ behavior: 'auto', block: 'nearest', inline: 'nearest' }); } }