From b5ce22f1e350431adaefbad40cbfc54dbfdb1c77 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 8 Jul 2020 08:35:24 +0200 Subject: [PATCH] Fix line-wise pasting on Chrome Windows Closes #6337 --- src/input/input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +}