diff --git a/src/input/input.js b/src/input/input.js index 8519ecfb7..32adbf9b2 100644 --- a/src/input/input.js +++ b/src/input/input.js @@ -51,7 +51,7 @@ export function applyTextInput(cm, inserted, deleted, sel, origin) { from = Pos(from.line, from.ch - deleted) else if (cm.state.overwrite && !paste) // Handle overwrite to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) - else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) + else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n")) from = to = Pos(from.line, 0) } let changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, @@ -132,4 +132,4 @@ export function hiddenTextarea() { if (ios) te.style.border = "1px solid black" disableBrowserMagic(te) return div -} \ No newline at end of file +}