From c9fc36730aa63152245543ae9cb4c92b9bc834bd Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke <marijnh@gmail.com>
Date: Mon, 7 Jan 2013 12:00:46 +0100
Subject: [PATCH] Make the hidden textarea wide on Webkit, to prevent wrap=off
 from making big pastes slow

Issue #1136
---
 lib/codemirror.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/codemirror.js b/lib/codemirror.js
index 3a20b3989..32d55b8f9 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -84,7 +84,8 @@ window.CodeMirror = (function() {
   function makeDisplay(place) {
     var d = {};
     var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none;");
-    if (!webkit) input.setAttribute("wrap", "off");
+    if (webkit) input.style.width = "1000px";
+    else input.setAttribute("wrap", "off");
     input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off");
     // Wraps and hides input textarea
     d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
-- 
GitLab