Patchwork hgweb: pull line numbers out of main flow of source content

login
register
mail settings
Submitter Paul Fisher
Date March 23, 2015, 8:57 p.m.
Message ID <2bf197c648b4431c2137.1427144253@doughty.cam.corp.google.com>
Download mbox | patch
Permalink /patch/8222/
State Accepted
Commit 811a1842cfe5f632145912d9bf2dc859e6ee3eeb
Headers show

Comments

Paul Fisher - March 23, 2015, 8:57 p.m.
# HG changeset patch
# User Paul Fisher <pfish@google.com>
# Date 1427136455 14400
#      Mon Mar 23 14:47:35 2015 -0400
# Node ID 2bf197c648b4431c213760af8f1b4c86a0b3dac7
# Parent  1cfded2fa1a92ee9b55d1f62675569e340a39083
hgweb: pull line numbers out of main flow of source content

Pulls the autogenerated line number boxes outside of the padding box
of the main content of .sourcelines, allowing the first tab
to be properly sized and the line numbers to be outside
the main source's margin when text is wrapped.
Matt Mackall - March 23, 2015, 9:09 p.m.
On Mon, 2015-03-23 at 16:57 -0400, Paul Fisher wrote:
> # HG changeset patch
> # User Paul Fisher <pfish@google.com>
> # Date 1427136455 14400
> #      Mon Mar 23 14:47:35 2015 -0400
> # Node ID 2bf197c648b4431c213760af8f1b4c86a0b3dac7
> # Parent  1cfded2fa1a92ee9b55d1f62675569e340a39083
> hgweb: pull line numbers out of main flow of source content

Very nice, queued for default. Congratulations on your first Mercurial
patch.

Patch

diff -r 1cfded2fa1a9 -r 2bf197c648b4 mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css	Fri Mar 20 17:30:38 2015 -0500
+++ b/mercurial/templates/static/style-paper.css	Mon Mar 23 14:47:35 2015 -0400
@@ -239,8 +239,9 @@ 
 
 .sourcelines > span {
   display: inline-block;
+  box-sizing: border-box;
   width: 100%;
-  padding: 1px 0px;
+  padding: 1px 0px 1px 5em;
   counter-increment: lineno;
 }
 
@@ -251,8 +252,8 @@ 
   -ms-user-select: none;
   user-select: none;
   display: inline-block;
+  margin-left: -5em;
   width: 4em;
-  margin-right: 1em;
   font-size: smaller;
   color: #999;
   text-align: right;