Line numbering out of sync for Windows users

Calum Lind calumlind at gmail.com
Tue Nov 6 17:18:05 CET 2012


Hi

We are running cgit 0.9.2: http://git.deluge-torrent.org/deluge/ with
syntax highlighting enabled and a Windows user recently pointed out that
the line numbers for long files are getting out of sync with the code:
http://i.imgur.com/5HoNp.png

As most of our devs run Linux we never noticed before, however testing on
my Windows box revealed the same issue in Chrome, Firefox and Opera.

Upon investigating I found that removing "font-style:italic;" from the
following line in the css solves the issue as it appears that somehow an
extra pixel in height added.

    table.blob .slc  { color:#838183; font-style:italic; }

Debugging further I found that setting "display:none" in the span seems to
also fix the issue although the computed style still used
display:inline-block which is a bit odd and further testing in Opera makes
the entire line disappear so hopefully someone with more CSS knowledge can
come up with a better fix.


There is also another Opera specific bug I found while testing that again
causes line numbering to be out of sync, where if a span str class is an
empty line Opera will not create a blank line as in Firefox or Chrome, for
example on line 495 here:

http://git.deluge-torrent.org/deluge/tree/deluge/ui/gtkui/torrentview.py#n493

Adding a non-breaking space in html solved this but again not sure if this
would be the correct solution.

Thanks

Calum



More information about the CGit mailing list