From 8ad5c89f22b1c5f004e9156158e2b445ab991414 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 20 May 2010 17:40:59 -0400
Subject: [PATCH] Don't wrap quoted lines at all

---
 program/include/rcube_shared.inc |   43 ++++++++++++++++++++++++-------------------
 1 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index a130391..2c3e639 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -259,7 +259,12 @@
   $para = explode($break, $string);
   $string = '';
   while (count($para)) {
-    $list = explode(' ', array_shift($para));
+    $line = array_shift($para);
+    if ($line[0] == '>') {
+      $string .= $line.$break;
+      continue;
+    }
+    $list = explode(' ', $line);
     $len = 0;
     while (count($list)) {
       $line = array_shift($list);
@@ -270,25 +275,25 @@
         $string .= ($len ? ' ' : '').$line;
         $len += (1 + $l);
       } else {
-	if ($l > $width) {
-	  if ($cut) {
-	    $start = 0;
-	    while ($l) {
-	      $str = mb_substr($line, $start, $width);
-	      $strlen = mb_strlen($str);
-	      $string .= ($len ? $break : '').$str;
-	      $start += $strlen;
-	      $l -= $strlen;
-	      $len = $strlen;
-	    }
-	  } else {
-            $string .= ($len ? $break : '').$line;
-	    if (count($list)) $string .= $break;
-	    $len = 0;
-	  }
-	} else {
+        if ($l > $width) {
+          if ($cut) {
+            $start = 0;
+            while ($l) {
+              $str = mb_substr($line, $start, $width);
+              $strlen = mb_strlen($str);
+              $string .= ($len ? $break : '').$str;
+              $start += $strlen;
+              $l -= $strlen;
+              $len = $strlen;
+            }
+          } else {
+                $string .= ($len ? $break : '').$line;
+            if (count($list)) $string .= $break;
+            $len = 0;
+          }
+        } else {
           $string .= $break.$line;
-	  $len = $l;
+          $len = $l;
         }
       }
     }

--
Gitblit v1.9.1