aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/gitcommit.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-23 10:48:27 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-23 10:48:27 +1200
commitcc8cc00508c8fd16c7a33307ee5e183909476e1d (patch)
tree1ccee2fd0bb886bee94dda5d3adce048762a4577 /vim/autoload/gitcommit.vim
parentMerge branch 'hotfix/v1.37.1' (diff)
parentBump VERSION (diff)
downloaddotfiles-090120265f10dd6d5859d5e704d098d0c9170379.tar.gz (sig)
dotfiles-090120265f10dd6d5859d5e704d098d0c9170379.zip
Merge branch 'hotfix/v1.37.2'v1.37.2
* hotfix/v1.37.2: Bump VERSION Refactor Git commit cursor column with snip line Set gitconfig commit.verbose, clear commit.status
Diffstat (limited to 'vim/autoload/gitcommit.vim')
-rw-r--r--vim/autoload/gitcommit.vim21
1 files changed, 11 insertions, 10 deletions
diff --git a/vim/autoload/gitcommit.vim b/vim/autoload/gitcommit.vim
index 56b35ba6..170cc2d0 100644
--- a/vim/autoload/gitcommit.vim
+++ b/vim/autoload/gitcommit.vim
@@ -1,18 +1,19 @@
" Choose the color column depending on non-comment line count
function! gitcommit#CursorColumn() abort
- " Last line number
- let l:ll = line('$')
-
" If we can find a line after the first that isn't a comment, we're
" composing the message
- if l:ll > 1
- for l:li in range(2, l:ll)
- if getline(l:li) !~# '^\s*#'
- return '+1'
- endif
- endfor
- endif
+ for l:num in range(1, line('$'))
+ if l:num == 1
+ continue
+ endif
+ let l:line = getline(l:num)
+ if strpart(l:line, 0, 1) !=# '#'
+ return '+1'
+ elseif l:line =~# '^# -\{24} >8 -\{24}$'
+ break
+ endif
+ endfor
" Otherwise, we're still composing our subject
return '51'