The logic for selecting line range is different to what GitHub does, but this seems reasonable to me as well.
Ok it works fine but fails if you select, for example, line 8 and line 10.
8
10
I could fix it with the following change:
- for (var i = lines[lines.length - 1]; i >= lines[0]; i--) { + for (var i = parseInt(lines[lines.length - 1]); i >= parseInt(lines[0]); i--) {
If you would like to integrate it and rebase your branch, I'll merge the PR :)
You're right, I only tested on a file with 8 lines total. Updated and rebased on master.
Took me a while to find the parseInt but it's there.
parseInt
Looks good to me, thanks!