You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Line-based Copy/Paste has different behavior on Windows vs. Linux #6337
When using line-based (no highlighting) copy-paste, there is different behavior between Windows and Linux. The Linux behavior is preferred, as it is similar to other text or code editors like Notepad++ or Visual Studio.
Environments Tested
Browsers Tested:
Chrome 83.0.4103.116 (Official Build) (64-bit) on Windows 10 Version 1903
Chrome 83.0.4103.112 (Official Build) (64-bit) on ChromeOS
On ChromeOS/Linux, this is the result, which is desirable and expected:
<!-- Create a simple CodeMirror instance -->
<link rel="stylesheet" href="lib/codemirror.css">
<script src="lib/codemirror.js"></script>
<script>
var editor = CodeMirror.fromTextArea(myTextarea, {
var editor = CodeMirror.fromTextArea(myTextarea, {
lineNumbers: true
});
</script>
On Windows, this is the result, which is problematic and unexpected (note that the line was embedded in the middle of the paste position, rather than being placed above it):
<!-- Create a simple CodeMirror instance -->
<link rel="stylesheet" href="lib/codemirror.css">
<script src="lib/codemirror.js"></script>
<script>
var editor = CodeMirror.fromTextArea(myTextarea, {
lineNum var editor = CodeMirror.fromTextArea(myTextarea, {
bers: true
});
</script>
As someone who regularly switches between Windows and Linux, it would be useful to be consistent between the versions, preferably in favor of the way the Linux version handles it. Thanks!
Activity
marijnh commentedon Jul 8, 2020
This was caused by the code getting confused by
\rcharacters in the pasted text. Attached patch seems to fix it.Update/5.58.2 (#1)
Fix line-wise pasting on Chrome Windows