diff options
author | Teddy Wing | 2019-06-08 11:11:55 +0200 |
---|---|---|
committer | Teddy Wing | 2019-06-08 11:33:03 +0200 |
commit | 8b0dfdbeca4f6eb34fe963427570436363fde3c4 (patch) | |
tree | e9a069fc49eafa666662b9f3a1409321a3c5bdf7 /projects/aodocs.vim | |
parent | 3095d7338bf244d2e163edc6d6d10c7968122afb (diff) | |
download | dotvim-8b0dfdbeca4f6eb34fe963427570436363fde3c4.tar.bz2 |
projects/aodocs.vim: Make commit title length variable based on issue ID
Make the commit title length 72 characters plus the length of the ID
followed by a colon and space.
Diffstat (limited to 'projects/aodocs.vim')
-rw-r--r-- | projects/aodocs.vim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/projects/aodocs.vim b/projects/aodocs.vim index 77c57d6..fc67ab5 100644 --- a/projects/aodocs.vim +++ b/projects/aodocs.vim @@ -22,7 +22,13 @@ augroup END " subsequent lines. function! s:CommitWackoTextWidth() if line('.') == 1 - setlocal textwidth=80 + " Match "CO-123: " + let matches = matchlist(getline('.'), '^\u\+-\d\+: ') + + if !empty(matches) + let id_prefix_length = len(matches[0]) + execute 'setlocal textwidth=' . (72 + id_prefix_length) + endif else setlocal textwidth=72 endif |