From 584423abae23f781bdb034b11115a166a0533dc3 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 11 Apr 2017 21:00:57 -0700 Subject: [PATCH] Fixed pasting in single line editor (#140) --- app/ui/components/codemirror/code-editor.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/ui/components/codemirror/code-editor.js b/app/ui/components/codemirror/code-editor.js index 609d32e74..f119a437f 100644 --- a/app/ui/components/codemirror/code-editor.js +++ b/app/ui/components/codemirror/code-editor.js @@ -459,9 +459,7 @@ class CodeEditor extends PureComponent { const text = change.text .join('') // join all changed lines into one .replace(/\n/g, ' '); // Convert all whitespace to spaces - const from = {ch: change.from.ch, line: 0}; - const to = {ch: from.ch + text.length, line: 0}; - change.update(from, to, [text]); + change.update(change.from, change.to, [text]); } }