aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/gitcommit.vim
blob: 7aba1c5bdc5a486d0115edbed7ac4eae71a0391d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
" Choose the color column depending on non-comment line count
function! gitcommit#CursorColumn() abort

  " If we can find a line after the first that isn't a comment, we're
  " composing the message
  for num in range(1, line('$'))
    if num == 1
      continue
    endif
    let line = getline(num)
    if strpart(line, 0, 1) !=# '#'
      return '+1'
    elseif line =~# '^# -\{24} >8 -\{24}$'
      break
    endif
  endfor

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

endfunction