aboutsummaryrefslogtreecommitdiffstats
path: root/projects/aodocs.vim
diff options
context:
space:
mode:
authorTeddy Wing2019-06-08 11:11:55 +0200
committerTeddy Wing2019-06-08 11:33:03 +0200
commit8b0dfdbeca4f6eb34fe963427570436363fde3c4 (patch)
treee9a069fc49eafa666662b9f3a1409321a3c5bdf7 /projects/aodocs.vim
parent3095d7338bf244d2e163edc6d6d10c7968122afb (diff)
downloaddotvim-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.vim8
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