Skip to content

Commit ce8d1e7

Browse files
committed
Revert "When pasting on Webkit, add a nonsense character to work around browser bug"
This reverts commit d59e2ae.
1 parent fd4743a commit ce8d1e7

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

lib/codemirror.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,8 +1447,6 @@ window.CodeMirror = (function() {
14471447
resetInput(cm, true);
14481448
return false;
14491449
}
1450-
if (cm.state.pasteIncoming && cm.state.fakedLastChar)
1451-
text = text.substring(0, text.length - 1);
14521450

14531451
var withOp = !cm.curOp;
14541452
if (withOp) startOperation(cm);
@@ -1595,18 +1593,6 @@ window.CodeMirror = (function() {
15951593
fastPoll(cm);
15961594
});
15971595
on(d.input, "paste", function() {
1598-
// Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206
1599-
// Add a char to the end of textarea before paste occur so that
1600-
// selection doesn't span to the end of textarea.
1601-
if (webkit) {
1602-
var start = d.input.selectionStart, end = d.input.selectionEnd;
1603-
d.input.value += "$";
1604-
d.input.selectionStart = start;
1605-
d.input.selectionEnd = end;
1606-
cm.state.fakedLastChar = true;
1607-
} else {
1608-
cm.state.fakedLastChar = false;
1609-
}
16101596
cm.state.pasteIncoming = true;
16111597
fastPoll(cm);
16121598
});

0 commit comments

Comments
 (0)