Line numbering out of sync for Windows users

Ferry Huberts mailings at hupie.com
Tue Nov 6 17:30:07 CET 2012


I had the same issue, when integrated in trac.
trac seemed to remove the empty lines, so I changed the highlight script 
to do (I'm using highlight 3, on CentOS 6.3):

> # the sed command is a workaround for empty lines getting filtered out by trac
> exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null | sed -r 's/^[[:space:]]*$/<!-- -->/'


Regards


On 06/11/12 17:18, Calum Lind wrote:
> 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
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit
>

-- 
Ferry Huberts




More information about the CGit mailing list