This is looking good. Thanks for doing this. A few changes though.
This is looking good, but this line is going to cause a problem. Only non-equal lines should have an index set. This line should probably be moved into the next conditional. Also, we need to set it to k, not j, so that the indexes in the diff viewer are like "1 2 3 4 5" rather than "1 4 6" etc.
We should be able to get rid of the interesting variable by just modifying file['changed_chunks'] directly.
Fix duplicate id attributes in diff view
Review Request #172 — Created Oct. 22, 2007 and submitted
|Review Board SVN (deprecated)|
Not all chunks were getting an index attribute assigned, which lead to many tbody elements in the diff view having the same id attribute (e.g, "chunk0."). Now all chunks are indexed. Also removed some unnecessary work from diffutils.add_navigation_cues while I was at it.
Verified that all chunks in a given patch now have unique id attributes. Verified that the change index at the top and bottom of the diff still functions correctly. Verified that only changed chunks are selected when using keyboard shortcuts such as j/k or n/p.
Looks great! Committing. Thanks :)