Skip to content

Commit

Permalink
plugin/magit.vim: <cr> toggle vim folding (ref #71)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreybert committed Feb 24, 2017
1 parent 702cff8 commit 9955b8a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/magit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,12 @@ endfunction
function! magit#open_close_folding_wrapper(mapping, ...)
if ( getline(".") =~ g:magit_file_re )
return call('magit#open_close_folding', a:000)
elseif ( foldlevel(line(".")) == 2 )
if ( foldclosed(line('.')) == -1 )
foldclose
else
foldopen
endif
else
silent! execute "silent! normal! " . a:mapping
endif
Expand Down

0 comments on commit 9955b8a

Please sign in to comment.