jreybert / vimagit

Ease your git workflow within Vim
1.31k stars 49 forks source link

An error occurs when commit set at the end of magit_default_sections #149

Closed iaia closed 7 years ago

iaia commented 7 years ago

Short description of the problem

An error occurs when commit is set at the end of g:magit_default_sections

Error detected while processing function magit#commit_command[24]..magit#update_buffer[20]..<SNR>19_mg_get_commit_msg:
line    3:
E684: list index out of range: 5
E15: Invalid expression: '^'.g:magit_sections[g:magit_default_sections[match(g:magit_default_sections, 'commit')+1]].'$'
Press ENTER or type command to continue

Steps to reproduce

e.g. let g:magit_default_sections = ['global_help', 'info', 'unstaged', 'staged', 'commit']

In stage mode, type CC.

Environment

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 22 2017 18:11:06)

jreybert commented 7 years ago

Damn it, I thought this corner case would never be spotted by anyone!

Thanks for the PR.

jreybert commented 7 years ago

Thanks for the PR!