aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/gitcommit.vim
blob: 56b35ba65aebd3f5cb3f24fac62909aa426edb06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" 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

  " Otherwise, we're still composing our subject
  return '51'

endfunction