We've been having trouble with the diff viewer highlighting the wrong
part of the file (e.g., it highlights 6 lines as being added, but
those 6 lines are 12 lines above the lines that were actually added).
I finally root-caused this to embedded control characters inside
comments.  This source, for better or for worse, has comments like

/* ^L */

where ^L is literally a control-L.  In vi with :number set, this appears as:


 889
 890 /* ^L */
 891

In the reviewboard diff viewer, this appears as:


889
890 /*
891  */
892

so for every /* ^L */ comment, reviewboard's idea of the line number
gets skewed by one, leading to the wrong view of what lines have
changed.

It looks like it's pygments that's doing this:

>>> data="/* ^L */\n"
>>> print pygments.highlight(data, lexer, HtmlFormatter()).splitlines()
[u'<div class="highlight"><pre>/* ', u' */', u'</pre></div>']

I poked through the pygments documentation but couldn't find
documentation on this feature.  Does anyone more familiar with
pygments know if there is a way to configure it to avoid this
behavior?  Perhaps I could work around this by adding a pygments
filter to convert ^L to actual characters (or do this in
apply_pygments())?

Thanks,
  Bill

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to