Search backend: sort line matches before limit truncation
Created by: camdencheek
When we truncate a FileMatch with Limit(), we just chop off any line
matches past the number we're limiting to. With merged results, this
usually means truncating primarily the second FileMatch's line matches,
so for a query like a and b
, we might truncate all the line matches of
b
. This makes things look a little broken in the UI because you can
see highlights for a
, and also see b
on the same line that seems
like it should be highlighted, but it's not. By sorting the line
matches before truncating, we just remove line matches towards the end
of the file, which I think is more intuitive and looks less broken.