From 22208946de47abbcaab19080eb9da6de35e25078 Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 25 Oct 2020 12:45:05 +0000 Subject: [PATCH 1/2] Correctly extract last character on paste --- packages/jupyterlab-lsp/src/editor_integration/codemirror.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jupyterlab-lsp/src/editor_integration/codemirror.ts b/packages/jupyterlab-lsp/src/editor_integration/codemirror.ts index e4f3a4f7d..72f2dd2fb 100644 --- a/packages/jupyterlab-lsp/src/editor_integration/codemirror.ts +++ b/packages/jupyterlab-lsp/src/editor_integration/codemirror.ts @@ -230,7 +230,8 @@ export abstract class CodeMirrorIntegration protected extract_last_character(change: CodeMirror.EditorChange): string { if (change.origin === 'paste') { - return change.text[0][change.text.length - 1]; + let last_line = change.text[change.text.length - 1]; + return last_line[last_line.length - 1]; } else { return change.text[0][0]; } From 0f5e70ecb3fd4b5d0fd3c83d7dd487c2ff655256 Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 25 Oct 2020 14:11:04 +0000 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d9e4f42b..087982399 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ - bug fixes - custom cell syntax highlighting is now properly removed when no longer needed ([#387]) + - the completer in continuous hinting now works well with the pasted text ([#389]) [#387]: https://github.com/krassowski/jupyterlab-lsp/issues/387 +[#389]: https://github.com/krassowski/jupyterlab-lsp/issues/389 ### `@krassowski/jupyterlab-lsp 2.0.7` (2020-09-18)