Skip to content

Commit 6b868d2

Browse files
authored
Merge pull request #389 from krassowski/fix-380-do-not-trigger-on-paste
Correctly extract last character on paste
2 parents 6fdbfb7 + 0f5e70e commit 6b868d2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
- bug fixes
66

77
- custom cell syntax highlighting is now properly removed when no longer needed ([#387])
8+
- the completer in continuous hinting now works well with the pasted text ([#389])
89

910
[#387]: https://github.com/krassowski/jupyterlab-lsp/issues/387
11+
[#389]: https://github.com/krassowski/jupyterlab-lsp/issues/389
1012

1113
### `@krassowski/jupyterlab-lsp 2.0.7` (2020-09-18)
1214

packages/jupyterlab-lsp/src/editor_integration/codemirror.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ export abstract class CodeMirrorIntegration
230230

231231
protected extract_last_character(change: CodeMirror.EditorChange): string {
232232
if (change.origin === 'paste') {
233-
return change.text[0][change.text.length - 1];
233+
let last_line = change.text[change.text.length - 1];
234+
return last_line[last_line.length - 1];
234235
} else {
235236
return change.text[0][0];
236237
}

0 commit comments

Comments
 (0)