Closed Bug 1434816 Opened 7 years ago Closed 7 years ago

Code not lined up with line numbers

Categories

(Webtools :: Searchfox, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: kats)

References

Details

Starting today, searchfox code and line numbers no longer line up for me on Mac. Links from search results go to the right line but wrong code. Large files have tons of line numbers at the end that don't correspond to any code. Given the timing, this is presumably fallout from bug 1322740. As a simple example, if I load https://searchfox.org/mozilla-central/source/dom/events/Event.h and scroll to the bottom, the code ends around line number 397, but there are 430 lines in the file... It looks like this is happening because I have a minimum font size of 13 set in my preferences. Searchfox is trying to set a 12px (!!!) font-size on both the line numbers and the code, which is smaller than 13px... I don't know why they don't end up getting affected identically, offhand, but 12px is _way_ too small to be readable for text anyway. So right now I have the choice between unreadably small and misaligned. :(
I guess https://github.com/mozsearch/mozsearch/commit/8cf5d922b79b430a05417371289200ff377af5fe set the max height of the lines of code but not the line numbers? And it set it to below the line-height a 13px font has... Fwiw, over here now I have 15.6px-tall code lines and 16.9px-tall line numbers (just looking at the dimensions of the blocks).
I can confirm that setting the minimum font size (about:preferences -> Content -> Advanced -> Minimum font size) to 13 or greater results in misalignment. Sorry for my part in causing this regression...
Applying the same max-height to .line-number fixes the alignment, at least.
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #3) > Applying the same max-height to .line-number fixes the alignment, at least. For now I'll do this. If anybody is using a minimum font size larger than 16px then their lines are going to overlap. We can deal with that if anybody runs into that problem. I've merged the PR and deployed the fix directly as well so this bug should be fixed now.
Assignee: nobody → bugmail
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.