[PATCH v3 7/7] contrib/git-jump/git-jump: jump to match column in addition to line
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Apr 24, 2018, 05:07 UTC
- Message-ID
- <23ea226b544e9e5fcdbbcda3adb5982e2cae2123.1524545768.git.me@ttaylorr.com>
- In-Reply-To
- <cover.1524545768.git.me@ttaylorr.com>
Take advantage of 'git-grep(1)''s new option, '--column-number' in order to teach Peff's 'git-jump' script how to jump to the correct column for any given match.
'git-grep(1)''s output is in the correct format for Vim's jump list, so no additional cleanup is necessary.
Signed-off-by: Taylor Blau <me@ttaylorr.com> --- contrib/git-jump/git-jump | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump index 80ab0590bc..8bc57ea0f8 100755 --- a/contrib/git-jump/git-jump +++ b/contrib/git-jump/git-jump @@ -52,7 +52,7 @@ mode_merge() { # editor shows them to us in the status bar. mode_grep() { cmd=$(git config jump.grepCmd) - test -n "$cmd" || cmd="git grep -n" + test -n "$cmd" || cmd="git grep -n --column-number" $cmd "$@" | perl -pe ' s/[ \t]+/ /g;
-- 2.17.0