Skip to content

Commit b5ce22f

Browse files
committed
Fix line-wise pasting on Chrome Windows
Closes #6337
1 parent e2d786c commit b5ce22f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/input/input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function applyTextInput(cm, inserted, deleted, sel, origin) {
5151
from = Pos(from.line, from.ch - deleted)
5252
else if (cm.state.overwrite && !paste) // Handle overwrite
5353
to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length))
54-
else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
54+
else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n"))
5555
from = to = Pos(from.line, 0)
5656
}
5757
let changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,
@@ -132,4 +132,4 @@ export function hiddenTextarea() {
132132
if (ios) te.style.border = "1px solid black"
133133
disableBrowserMagic(te)
134134
return div
135-
}
135+
}

0 commit comments

Comments
 (0)