]> Sergey Matveev's repositories - public-inbox.git/commitdiff
viewvcs: disable white-space prewrap in blob view
authorEric Wong <e@80x24.org>
Sun, 20 Jan 2019 12:18:35 +0000 (12:18 +0000)
committerEric Wong <e@80x24.org>
Sun, 20 Jan 2019 20:22:45 +0000 (20:22 +0000)
We need to keep line-numbers from <a> tags synced to the actual
line numbers in the code when working in smaller viewports.

Maybe I only work on reasonable projects, but excessively
long lines seem to be less of a problem in code than they are
in emails.

lib/PublicInbox/ViewVCS.pm

index 61f4debadda6dc5257e703fd4807fc2a0a9f269e..4a3896d4b689f257e8becc1db705d36c637f6545 100644 (file)
@@ -100,7 +100,8 @@ sub show ($$;$) {
                        sprintf("<a id=n$_ href=#n$_>% ${pad}u</a>\n", $_)
                } (1..$nl)) . '</pre></td>' .
                '<td><pre> </pre></td>'. # pad for non-CSS users
-               "<td\nclass=lines><pre><code>" .  ascii_html($$blob) .
+               "<td\nclass=lines><pre\nstyle='white-space:pre'><code>" .
+               ascii_html($$blob) .
                '</code></pre></td></tr></table>' . $log;
 
        html_page($ctx, 200, \$log);