Skip to content

Commit

Permalink
Handle commit set at the end of magit_default_sections
Browse files Browse the repository at this point in the history
ref #149
  • Loading branch information
iaia authored and jreybert committed Nov 7, 2017
1 parent 14be6c1 commit c1f0a8a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugin/magit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,13 @@ endfunction
function! s:mg_get_commit_msg(...)
let commit_section_pat_start='^'.g:magit_sections.commit.'$'
" Get next section pattern with g:magit_default_sections order
let commit_section_pat_end='^'.g:magit_sections[g:magit_default_sections[match(g:magit_default_sections, 'commit')+1]].'$'
let commit_position = match(g:magit_default_sections, 'commit')
if ( commit_position + 1 == len(g:magit_default_sections) )
let commit_section_pat_end='\%$'
else
let commit_section_pat_end='^'.g:magit_sections[g:magit_default_sections[commit_position+1]].'$'
endif

let commit_jump_line = 2
let out_of_block = a:0 == 1 ? a:1 : 0
if ( out_of_block )
Expand Down

0 comments on commit c1f0a8a

Please sign in to comment.