aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-03-10 14:14:11 +1300
committerTom Ryder <tom@sanctum.geek.nz>2020-04-05 22:05:52 +1200
commita7bfabb96fa5b186447839de048629d0aa53b154 (patch)
treeb61f92abb9dff49012e29319e863408f634ed35c
parentMerge branch 'release/v8.13.0' into develop (diff)
downloaddotfiles-a7bfabb96fa5b186447839de048629d0aa53b154.tar.gz
dotfiles-a7bfabb96fa5b186447839de048629d0aa53b154.zip
Check for existence of 'colorcolumn' option
-rw-r--r--vim/after/ftplugin/gitcommit.vim16
1 files changed, 9 insertions, 7 deletions
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim
index 4a1c3814..093dc5f5 100644
--- a/vim/after/ftplugin/gitcommit.vim
+++ b/vim/after/ftplugin/gitcommit.vim
@@ -4,13 +4,15 @@ setlocal formatoptions+=coqr
let b:undo_ftplugin .= '|setlocal comments< formatoptions<'
" Choose the color column depending on non-comment line count
-augroup gitcommit_cursorcolumn
- autocmd CursorMoved,CursorMovedI <buffer>
- \ let &l:colorcolumn = gitcommit#CursorColumn()
-augroup END
-let b:undo_ftplugin .= '|execute ''autocmd! gitcommit_cursorcolumn'''
- \ . '|augroup! gitcommit_cursorcolumn'
- \ . '|setlocal colorcolumn<'
+if exists('&colorcolumn')
+ augroup gitcommit_cursorcolumn
+ autocmd CursorMoved,CursorMovedI <buffer>
+ \ let &l:colorcolumn = gitcommit#CursorColumn()
+ augroup END
+ let b:undo_ftplugin .= '|execute ''autocmd! gitcommit_cursorcolumn'''
+ \ . '|augroup! gitcommit_cursorcolumn'
+ \ . '|setlocal colorcolumn<'
+endif
" Stop here if the user doesn't want ftplugin mappings
if exists('no_plugin_maps') || exists('no_gitcommit_maps')