Fixed word wrap regular expression.
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Mon, 2 Mar 2009 06:13:48 +0000 (01:13 -0500)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Mon, 2 Mar 2009 06:13:48 +0000 (01:13 -0500)
GrowlITTSWController.m

index b5c762b..1cd4265 100644 (file)
        }
        
        if (_wrapNotifications) {
        }
        
        if (_wrapNotifications) {
-               text = [text stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"(.{1,%i})(?: +|$)\\n?|(.{%i})", _wrapColumns, _wrapColumns] withString:@"$1$2\n"];
+               text = [text stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"(\\S\\S{%i,}|.{1,%i})(?:\\s+|$)", _wrapColumns, _wrapColumns] withString:@"$1\n"];
        }
        
        //trim trailing whitespace
        }
        
        //trim trailing whitespace