Merge branch 'fix-jumping'

This commit is contained in:
Marco Hinz 2013-07-21 15:22:00 +02:00
commit 6f95251190
2 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@ function! sy#jump#next_hunk(count)
let lnum = line('.')
let hunks = filter(copy(g:sy[g:sy_path].hunks), 'v:val.start > lnum')
let hunk = get(hunks, a:count - 1, {})
let hunk = get(hunks, a:count - 1, get(hunks, -1, {}))
if !empty(hunk)
execute 'sign jump '. hunk.ids[0] .' file='. g:sy_path
@ -28,7 +28,7 @@ function! sy#jump#prev_hunk(count)
let lnum = line('.')
let hunks = filter(copy(g:sy[g:sy_path].hunks), 'v:val.start < lnum')
let hunk = get(hunks, 0 - a:count, {})
let hunk = get(hunks, 0 - a:count, get(hunks, 0, {}))
if !empty(hunk)
execute 'sign jump '. hunk.ids[0] .' file='. g:sy_path

View File

@ -61,15 +61,15 @@ com! -nargs=0 -bar SyDebug call sy#debug#list_active_buffe
" Init: mappings {{{1
if exists('g:signify_mapping_next_hunk')
execute 'nnoremap <silent> '. g:signify_mapping_next_hunk .' :<c-u>execute v:count ."SignifyJumpToNextHunk"<cr>'
execute 'nnoremap <silent> '. g:signify_mapping_next_hunk .' :<c-u>execute v:count1 ."SignifyJumpToNextHunk"<cr>'
else
nnoremap <silent> <leader>gj :<c-u>execute v:count .'SignifyJumpToNextHunk'<cr>
nnoremap <silent> <leader>gj :<c-u>execute v:count1 .'SignifyJumpToNextHunk'<cr>
endif
if exists('g:signify_mapping_prev_hunk')
execute 'nnoremap <silent> '. g:signify_mapping_prev_hunk .' :<c-u>execute v:count ."SignifyJumpToPrevHunk"<cr>'
execute 'nnoremap <silent> '. g:signify_mapping_prev_hunk .' :<c-u>execute v:count1 ."SignifyJumpToPrevHunk"<cr>'
else
nnoremap <silent> <leader>gk :<c-u>execute v:count .'SignifyJumpToPrevHunk'<cr>
nnoremap <silent> <leader>gk :<c-u>execute v:count1 .'SignifyJumpToPrevHunk'<cr>
endif
if exists('g:signify_mapping_toggle_highlight')