I just wrote a function which tries to call another function, but I got the syntax wrong. However, I was horrified to see that the next line in my function happily started executing anyway. It is as if every line of my vimscript function has a try-catch around it; oh no! How do I disable this?
For example, try running
:call AmendCommit("098ajwe")<CR>. After the failure of the call to FixupCommit, the next line still tries to execute!
fu! FixupCommit(commit_hash) execute "Git commit --fixup=" . a:commit_hash endfunction fu! AmendCommit(commit_hash) FixupCommit(commit_hash) execute "Git rebase --autosquash " . a:commit_hash . "~1" endfunction