Description
If a template file starts with a user-defined function, then the template rendering code loops forever. I believe the problem is this line in template.vim, which, if matchstrpos() has returned a start position of 0 into l:c1, sets l:pre to the entire template file. I don't have time to test a fix, so please forgive the bug report in place of a pull request.