airblade / vim-gitgutter

A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks.
MIT License
8.35k stars 296 forks source link

deleted symbol not showing #700

Closed davy79 closed 4 years ago

davy79 commented 4 years ago

Hi,

I just noticed only "added" and "modified" signs show in the symbol column. The deleted sign does not show although the symbol column is added indicated by my line number column getting wider by 2 chars.

What is the latest commit SHA in your installed vim-gitgutter? 425c7cf2e21b3e9d13597ea1cf75d92a4180935a

not sure when this behavior started though...

What vim/nvim version are you on? NVIM v0.4.3 Build type: RelWithDebInfo LuaJIT 2.0.5 Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-proto types -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SO URCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/buil d/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/a uto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include Compiled by travis@travis-job-27b22526-64a7-4e92-9f8e-1f0b8288a453

Features: +acl +iconv +tui

things I've tried:

let g:gitgutter_sign_removed = '--' let g:gitgutter_sign_removed_first_line = '--' highlight GitGutterDelete guifg=#ff2222

any ideas how to fix this?

airblade commented 4 years ago

It sounds like the delete signs are being correctly placed, but you can verify there's a sign with the name GitGutterLineRemoved via:

:echo getbufinfo()[0].signs

I expect it's a colour problem, i.e. the foreground colour of the delete sign is the same as the background colour.

You can see the sign's definition like this:

:sign list GitGutterLineRemoved

It should include texthl=GitGutterDelete.

You can check the highlight group's colours with:

:highlight GitGutterDelete

When I execute :highlight GitGutterDelete guifg=#ff2222 (or any other rgb value for guifg) the sign changes colour immediately as expected.

davy79 commented 4 years ago

Thanks for the feedback!

Indeed I confirmed GitGutterDelete is equal to my background color.

executing :highlight GitGutterDelete guifg=#ff2222 indeed changes the symbol color and it shows up...

putting it in the vimrc file does not help though... I apply the misbehaving theme as an after so it overwrites vimrc settings... so after I put the :highlight GitGutterDelete guifg=#ff2222 in my after script it works now...

Thanks again for the help! closing the issue