Fixed pasting in single line editor (#140)

This commit is contained in:
Gregory Schier 2017-04-11 21:00:57 -07:00 committed by GitHub
parent f145b968be
commit 584423abae

View File

@ -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]);
}
}