I'm still a little confused about this check.  Doesn't this guarantee that `extraCharacters` above is always < 0?

This does seem like it might cause scoring bugs: if I create a file `abc/def/zzz/abc/def` in my project and then search on "abc/def", the _first_ occurrence gets bolded instead of the last.  I assume that means the item doesn't get the "last segment" bonus that it deserves.