File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,16 @@ Obviously this trivial case isn't that interesting; you could just open
2929`foo.c` yourself. But when you have many changes scattered across a
3030project, you can use the editor's support to "jump" from point to point.
3131
32- Git-jump can generate three types of interesting lists:
32+ Git-jump can generate four types of interesting lists:
3333
3434 1. The beginning of any diff hunks.
3535
3636 2. The beginning of any merge conflict markers.
3737
3838 3. Any grep matches.
3939
40+ 4. Any whitespace errors detected by `git diff --check`.
41+
4042
4143Using git-jump
4244--------------
@@ -83,7 +85,7 @@ complete list of files and line numbers for each match.
8385Limitations
8486-----------
8587
86- This scripts was written and tested with vim. Given that the quickfix
88+ This script was written and tested with vim. Given that the quickfix
8789format is the same as what gcc produces, I expect emacs users have a
8890similar feature for iterating through the list, but I know nothing about
8991how to activate it.
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ diff: elements are diff hunks. Arguments are given to diff.
1212merge: elements are merge conflicts. Arguments are ignored.
1313
1414grep: elements are grep hits. Arguments are given to grep.
15+
16+ ws: elements are whitespace errors. Arguments are given to diff --check.
1517EOF
1618}
1719
@@ -25,7 +27,7 @@ mode_diff() {
2527 perl -ne '
2628 if (m{^\+\+\+ (.*)}) { $file = $1; next }
2729 defined($file) or next;
28- if (m/^@@ .*\+(\d+)/) { $line = $1; next }
30+ if (m/^@@ .*? \+(\d+)/) { $line = $1; next }
2931 defined($line) or next;
3032 if (/^ /) { $line++; next }
3133 if (/^[-+]\s*(.*)/) {
@@ -55,6 +57,10 @@ mode_grep() {
5557 '
5658}
5759
60+ mode_ws () {
61+ git diff --check " $@ "
62+ }
63+
5864if test $# -lt 1; then
5965 usage >&2
6066 exit 1
You can’t perform that action at this time.
0 commit comments