Skip to content
Snippets Groups Projects
Commit 7ce760fa authored by Jerome Reybert's avatar Jerome Reybert
Browse files

plugin/magit.vim: fix next/prev jump

parent 5d2c9417
No related branches found
No related tags found
No related merge requests found
...@@ -927,18 +927,20 @@ function! magit#jump_hunk(dir) ...@@ -927,18 +927,20 @@ function! magit#jump_hunk(dir)
let back = ( a:dir == 'P' ) ? 'b' : '' let back = ( a:dir == 'P' ) ? 'b' : ''
let line = search("^@@ ", back . 'wn') let line = search("^@@ ", back . 'wn')
if ( line != 0 ) if ( line != 0 )
if ( foldlevel(line('.')) == 2 )
try try
foldclose foldclose
catch /^Vim\%((\a\+)\)\=:E490/ catch /^Vim\%((\a\+)\)\=:E490/
endtry endtry
endif
call cursor(line, 0) call cursor(line, 0)
while ( foldclosed(line) != -1 )
try try
foldopen foldopen
catch /^Vim\%((\a\+)\)\=:E490/ catch /^Vim\%((\a\+)\)\=:E490/
echohl WarningMsg break
echom "Warning: you should have jumped on a folded hunk"
echohl None
endtry endtry
endwhile
endif endif
endfunction endfunction
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment