mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-11 04:53:46 -05:00
Echo message if no next/previous hunk is available
Gives some feedback when hunk navigation does nothing.
This commit is contained in:
committed by
Andy Stewart
parent
7f7451813c
commit
275d598196
@@ -39,10 +39,11 @@ function! gitgutter#hunk#next_hunk(count)
|
|||||||
let hunk_count += 1
|
let hunk_count += 1
|
||||||
if hunk_count == a:count
|
if hunk_count == a:count
|
||||||
execute 'normal!' hunk[2] . 'G'
|
execute 'normal!' hunk[2] . 'G'
|
||||||
break
|
return
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
echo 'No more hunks'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -56,10 +57,11 @@ function! gitgutter#hunk#prev_hunk(count)
|
|||||||
if hunk_count == a:count
|
if hunk_count == a:count
|
||||||
let target = hunk[2] == 0 ? 1 : hunk[2]
|
let target = hunk[2] == 0 ? 1 : hunk[2]
|
||||||
execute 'normal!' target . 'G'
|
execute 'normal!' target . 'G'
|
||||||
break
|
return
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
echo 'No previous hunks'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user