diff --git a/README.mkd b/README.mkd index 0a151cc..cefb9bc 100644 --- a/README.mkd +++ b/README.mkd @@ -287,7 +287,7 @@ else endif ``` -GitGutter will preserve non-gitgutter signs by default. If you don't want gitgutter to worry about this (e.g. if you use a NeoVim with an expanding sign column): +GitGutter can preserve or ignore non-gitgutter signs. On Vim and Neovim < 0.4.0, gitgutter will default to preserving other signs; on Neovim >= 0.4.0 gitgutter defaults to ignoring them. You can control this with: ```viml let g:gitgutter_sign_allow_clobber = 1 diff --git a/doc/gitgutter.txt b/doc/gitgutter.txt index bab6188..b5ed29a 100644 --- a/doc/gitgutter.txt +++ b/doc/gitgutter.txt @@ -377,10 +377,11 @@ the number of changed lines exceeds this value, the plugin removes all signs and displays a warning message. *g:gitgutter_sign_allow_clobber* -Default: 0 +Default: 0 (Vim, Neovim < 0.4.0) + 1 (Neovim >= 0.4.0) -Determines whether gitgutter preserves non-gitgutter signs (the default). When -1, gitgutter will not preserve non-gitgutter signs. +Determines whether gitgutter preserves non-gitgutter signs. When 1, gitgutter +will not preserve non-gitgutter signs. *g:gitgutter_sign_added* *g:gitgutter_sign_modified* diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 5251145..591c4db 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -28,6 +28,9 @@ 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_highlight_linenrs', 0) +if has('nvim-0.4.0') && !exists('g:gitgutter_sign_allow_clobber') + let g:gitgutter_sign_allow_clobber = 1 +endif call s:set('g:gitgutter_sign_allow_clobber', 0) call s:set('g:gitgutter_sign_column_always', 0) if g:gitgutter_sign_column_always && exists('&signcolumn')