From 8b0dfdbeca4f6eb34fe963427570436363fde3c4 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 8 Jun 2019 11:11:55 +0200 Subject: 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. --- projects/aodocs.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'projects') 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 -- cgit v1.2.3