]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: increase MAX_INLINE_QUOTED threshold to 12
authorEric Wong <e@80x24.org>
Thu, 28 Aug 2014 01:33:43 +0000 (01:33 +0000)
committerEric Wong <e@80x24.org>
Thu, 28 Aug 2014 02:47:11 +0000 (02:47 +0000)
12 lines is half an 80x24 terminal, so it is probably a reasonable
amount to quote.  Often 5 lines was not enough for context.  This
feature is mainly to reduce scrolling necessary to view pages.

lib/PublicInbox/View.pm
t/feed.t
t/view.t

index 0d97428116214626415f194c4ddf2e8a14279ac5..279433916ab488a6fe7979e1fbf9826c8f05aa9b 100644 (file)
@@ -11,7 +11,7 @@ use Email::MIME::ContentType qw/parse_content_type/;
 require POSIX;
 
 # TODO: make these constants tunable
-use constant MAX_INLINE_QUOTED => 5;
+use constant MAX_INLINE_QUOTED => 12; # half an 80x24 terminal
 use constant MAX_TRUNC_LEN => 72;
 use constant PRE_WRAP => '<pre style="white-space:pre-wrap">';
 
index 880716ccb4a3df9e1c0c6b6c30303542ca179894..978e21563fa3efdd69df0ec4c36d90d56c562855 100644 (file)
--- a/t/feed.t
+++ b/t/feed.t
@@ -31,6 +31,15 @@ Date: Thu, 01 Jan 1970 00:00:00 +0000
 > I quote to much
 > I quote to much
 > I quote to much
+> I quote to much
+> I quote to much
+> I quote to much
+> I quote to much
+> I quote to much
+> I quote to much
+> I quote to much
+> I quote to much
+> I quote to much
 
 msg $i
 
index bc6fbed9313da848f475e560625a3cef3f50864b..91ba16869820537fa1731bc9121aea84f12cb41b 100644 (file)
--- a/t/view.t
+++ b/t/view.t
@@ -18,7 +18,14 @@ OK
 > We generate links to a separate full page where quoted-text is inline.
 > This is
 >
-> Currently 5 lines
+> Currently 12 lines
+> See MAX_INLINE_QUOTED
+> See MAX_INLINE_QUOTED
+> See MAX_INLINE_QUOTED
+> See MAX_INLINE_QUOTED
+> See MAX_INLINE_QUOTED
+> See MAX_INLINE_QUOTED
+> See MAX_INLINE_QUOTED
 > See MAX_INLINE_QUOTED
 
 hello world