Merge branch 'fix-jumping'
This commit is contained in:
commit
6f95251190
@ -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
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user