E.g., passing an empty group name to the sign argument linehl (e.g.,
"linehl=") causes the following error:
```
Error detected while processing /usr/home/0mp/.vim/plugged/vim-gitgutter/plugin/gitgutter.vim[96]..function gitgutter#highlight#define_signs[10]..<SNR>56_define_sign_line_highlights:
line 9:
E1249: Group name missing for linehl
```
This patch makes the those errors go away by passing "None" when no
group name is needed.
Setting a colorscheme often clears all existing highlight groups. When
the plugin subsequently sets up its colours, it sees that the GitGutter*
groups exist and leaves them alone - even though they have been cleared.
This change means cleared groups do get their colours set up again.
See #727.
If GitGutter* highlight groups already exist, they were declared
deliberately (either by the colorscheme maintainer or the user). So do
not adjust them.
However if you would like to make the signs' backgrounds match the sign
column, you can do this:
let g:gitgutter_set_sign_backgrounds = 1
This was introduced in 07d7c9d4 because many colorschemes at the time
had ugly sign columns, and people kept asking how to deal with it.
These days there are many more plugins which use the sign column and
consequently more colorschemes pay attention to the SignColumn highlight
group.
Therefore it no longer makes sense for vim-gitgutter to adjust the
sign column's appearance.
To restore the previous behaviour, add this to your vimrc:
highlight! link SignColumn LineNr
See #696.
Specifically, make it match the signs' foreground colours; and clear the
backgrounds so the GitGutter{Add,Delete}IntraLine highlights' "reverse"
colours work properly.
Previously if the user or the colourscheme had already defined
GitGutter* highlight groups, the plugin would leave their backgrounds
alone. This pushed the responsibility for figuring out and specifying
the correct backgrounds onto the user or colourscheme maintainer.
With this change the plugin now sets the correct background on existing
GitGutter* highlight groups.
Also, the documentation was simplified so it is clearer how to set your
own colours for the signs.
This removes the g:gitgutter_sign_column_always option.
Vim 7.4.2201 introduced the |signcolumn| option to configure when the
signcolumn is visible, building in behaviour which the plugin provided
manually.
Although it would be good to maintain this feature for older Vims, the
complexity added by the code outweighs the benefit of backward
compatibility.
The development versions of v0.3.2 also report `has('nvim-0.3.2')` to be
true even if they do not support the `numhl` feature. So here it catches
and ignores the possible errors.
For default sign colours.
It seems the Diff* highlight groups are generally designed for line
highlighting so they have background colours which differ from the main
background colour. While desirable for line highlights, this isn't what
we want for the signs.
This change makes the plugin default to using the highlight groups
defined by the colorscheme instead of hardcoding its own foreground
colours.
If you liked the previous colours you can restore them by adding these
lines to your vimrc:
highlight GitGutterAdd guifg=#009900 guibg=<X> ctermfg=2 ctermb=<Y>
highlight GitGutterChange guifg=#bbbb00 guibg=<X> ctermfg=3 ctermb=<Y>
highlight GitGutterDelete guifg=#ff2222 guibg=<X> ctermfg=1 ctermb=<Y>
– where you should replace <X> and <Y> are the background colour of your
SignColumn in the gui and the terminal respectively.
For example, with the solarized colorscheme and a dark background,
guibg=#073642 and ctermbg=0.
Closes#545, #560.
- Hunk stage/undo/preview no longer saves the buffer.
- Hunk undo no longer makes locations go out of sync.
- Grep can be opted out of (grep output with ansi escapes is number one cause
of issues).
- Replaced g:gitgutter_grep_command with g:gitgutter_grep.
- Always runs git-diff the same way instead of in two possible ways.
- Separated detection of git tracking from diffing.
- Simplified path handling.
- Removed support for xolox shell: Windows taskbar does not flash with async
jobs.
- Removed g:gitgutter_{eager,realtime}.
- Simplified implementation generally.
Most colorschemes (e.g. solarized) don't give any thought to the
SignColumn highlight group so generally the sign column is ugly.
With this change vim-gitgutter defaults to making the sign column look
like the line number column.
Solarized users no longer need `highlight clear SignColumn` in their
vimrc :)
To stop vim-gitgutter from overriding the SignColumn highlight, add this
to your vimrc:
let g:gitgutter_override_sign_column_highlight = 0