aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/gitcommit.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/autoload/gitcommit.vim')
-rw-r--r--vim/autoload/gitcommit.vim22
1 files changed, 12 insertions, 10 deletions
diff --git a/vim/autoload/gitcommit.vim b/vim/autoload/gitcommit.vim
index 72d2b9ff..3547a2a6 100644
--- a/vim/autoload/gitcommit.vim
+++ b/vim/autoload/gitcommit.vim
@@ -1,22 +1,24 @@
-" Choose the color column depending on non-comment line count
-function! gitcommit#CursorColumn() abort
+vim9script
- " If we can find a line after the first that isn't a comment, we're
- " composing the message
- "
+# Choose the color column depending on non-comment line count
+export def CursorColumn(): string # Not "number"; might be a + prefix
+
+ # 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) !=# '#'
+ const line = getline(num)
+ if strpart(line, 0, 1) != '#'
return '+1'
- elseif line =~# '^# -\{24} >8 -\{24}$'
+ elseif line =~ '^# -\{24} >8 -\{24}$'
break
endif
endfor
- " Otherwise, we're still composing our subject
+ # Otherwise, we're still composing our subject
return '51'
-endfunction
+enddef