Yes, you're right. And now I have an idea of how I arrived at this line and the previous diff you commented on. Toward the end, I was tweaking things to ensure that the ordering I got for various searches was as desired. This one proved to be difficult:

```javascript
            it("should find the right samples/index", function () {
                expect(goodRelativeOrdering("samples/index", [
                    "samples/de/Erste Schritte/index.html",
                    "src/thirdparty/CodeMirror2/mode/ntriples/index.html"
                ])).toBe(true);
            });
```

It turns out that that test was passing because of what could only be described as a bug. On the one hand, it seems logical that "samples/index" would prefer that first match. But the second one is deceptively strong: it matches "ples/index" which is a bunch of consecutive characters that blend into the filename.

I'll need to think about a tweak to the scoring that will improve this case and some of the others that you proposed at the end of your review.