From 275d598196e7133fc36dde0dacdd21a436fb7709 Mon Sep 17 00:00:00 2001 From: Maximilian Antoni Date: Thu, 5 Mar 2015 10:20:36 +0100 Subject: [PATCH] Echo message if no next/previous hunk is available Gives some feedback when hunk navigation does nothing. --- autoload/gitgutter/hunk.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/gitgutter/hunk.vim b/autoload/gitgutter/hunk.vim index 9d895d8..67cc5af 100644 --- a/autoload/gitgutter/hunk.vim +++ b/autoload/gitgutter/hunk.vim @@ -39,10 +39,11 @@ function! gitgutter#hunk#next_hunk(count) let hunk_count += 1 if hunk_count == a:count execute 'normal!' hunk[2] . 'G' - break + return endif endif endfor + echo 'No more hunks' endif endfunction @@ -56,10 +57,11 @@ function! gitgutter#hunk#prev_hunk(count) if hunk_count == a:count let target = hunk[2] == 0 ? 1 : hunk[2] execute 'normal!' target . 'G' - break + return endif endif endfor + echo 'No previous hunks' endif endfunction