From dc73a81bfe59a9de090b89a1312ded3c6f6a6f89 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Wed, 2 Aug 2017 15:47:04 +0100 Subject: [PATCH] Deprecate g:gitgutter_sign_column_always for &signcolumn. --- README.mkd | 12 ++++++++++-- plugin/gitgutter.vim | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.mkd b/README.mkd index 4dc9ee97..83f10c20 100644 --- a/README.mkd +++ b/README.mkd @@ -134,7 +134,7 @@ And you can turn line highlighting on and off (defaults to off): Note that if you have line highlighting on and signs off, you will have an empty sign column – more accurately, a sign column with invisible signs. This is because line highlighting requires signs and Vim always shows the sign column even if the signs are invisible. -If you switch off both line highlighting and signs, you won't see the sign column. That is unless you have set `let g:gitgutter_sign_column_always = 1` so it's always there. +If you switch off both line highlighting and signs, you won't see the sign column. That is unless you configure the sign column always to be there (see Sign Column section). To keep your Vim snappy, vim-gitgutter will suppress itself when a file has more than 500 changes. As soon as the number of changes falls below the limit vim-gitgutter will show the signs again. You can configure the threshold with: @@ -270,7 +270,15 @@ highlight SignColumn ctermbg=whatever " terminal Vim highlight SignColumn guibg=whatever " gVim/MacVim ``` -By default the sign column will appear when there are signs to show and disappear when there aren't. If you would always like the sign column to be there, add `let g:gitgutter_sign_column_always = 1` to your `~/.vimrc`. +By default the sign column will appear when there are signs to show and disappear when there aren't. To always have the sign column, add to your vimrc: + +```viml +if exists('&signcolumn') " Vim 7.4.2201 + set signcolumn=yes +else + let g:gitgutter_sign_column_always = 1 +endif +``` #### Signs' colours and symbols diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 19a8df72..ad39bc17 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -32,6 +32,11 @@ call s:set('g:gitgutter_max_signs', 500) call s:set('g:gitgutter_signs', 1) call s:set('g:gitgutter_highlight_lines', 0) call s:set('g:gitgutter_sign_column_always', 0) +if g:gitgutter_sign_column_always && exists('&signcolumn') + set signcolumn=yes + let g:gitgutter_sign_column_always = 0 + call gitgutter#utility#warn('please replace "let g:gitgutter_sign_column_always=1" with "set signcolumn=yes"') +endif call s:set('g:gitgutter_override_sign_column_highlight', 1) call s:set('g:gitgutter_realtime', 1) call s:set('g:gitgutter_eager', 1)