Skip to content

Commit 2220894

Browse files
committed
Correctly extract last character on paste
1 parent 80459bf commit 2220894

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)