Commit 0b38789
Brian Lyles
Handle range-diff commit header lines in
While `range-diff` output doesn't display with any syntax highlighting,
it's still in a buffer with a filetype of 'git' and thus fugitive
attaches the standard jump mappings. However, those mappings work
inconsistently for `range-diff` output due to some accidental matching
in `s:cfile()`. For lines like these:
1: aaaaaaa = 1: bbbbbbb My subject
2: aaaaaaa = -: ------- My other subject
Depending on the position of the cursor, we sometimes hit the `<cword>`
fallback and open the commit. This can happen when the cursor is over a
commit hash, or even on one of the `:`. However, for a line like this:
-: ------- > 2: aaaaaaa My subject
We end up hitting the block intended to catch +/- lines in diff output,
and fail to identify a commit.
Add a special set of handling for range-diff header lines. In cases
where only one commit is present in the line, open that commit
automatically regardless of cursor position. For cases where the line
represents a different commit on each side, fall back to a `<cword>`
approach to allow opening either commit based on cursor position.s:cfile()
1 parent 320b18f commit 0b38789
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8135 | 8135 | | |
8136 | 8136 | | |
8137 | 8137 | | |
| 8138 | + | |
| 8139 | + | |
| 8140 | + | |
8138 | 8141 | | |
8139 | 8142 | | |
8140 | 8143 | | |
| |||
8232 | 8235 | | |
8233 | 8236 | | |
8234 | 8237 | | |
| 8238 | + | |
| 8239 | + | |
| 8240 | + | |
| 8241 | + | |
| 8242 | + | |
| 8243 | + | |
| 8244 | + | |
| 8245 | + | |
| 8246 | + | |
| 8247 | + | |
| 8248 | + | |
| 8249 | + | |
| 8250 | + | |
8235 | 8251 | | |
8236 | 8252 | | |
8237 | 8253 | | |
| |||
0 commit comments