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

bad highlighting prevents reading of :GitGutterPreviewHunk #742

Closed dyllandry closed 3 years ago

dyllandry commented 3 years ago

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

ea79bc01c2efc84cf8e71fbe5fd8adbf4242739d

What vim/nvim version are you on?

NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-gOb7vg/neovim-0.4.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-gOb7vg/neovim-0.4.3/build/config -I/build/neovim-gOb7vg/neovim-0.4.3/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-gOb7vg/neovim-0.4.3/build/src/nvim/auto -I/build/neovim-gOb7vg/neovim-0.4.3/build/include
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui

I cannot read the preview window, I suspect because of the colors.

git gutter colors

I used :hi <highlight group> to debug each of the highlight groups used, and they appeared readable.

highlight-groups

I suspect the cause is whichever highlight group is setting the fg color of that text to red & green.

If it helps, I'm using the vim-colors-github theme. github.vim

Does anyone know what highlight group I need to change?

dyllandry commented 3 years ago

Alright, I figured it out by looking in my vim-colors-github theme. At some point they set the colors for groups diffAdded and diffRemoved. They set them to two different colors, but I guess something about my terminal causes the two colors to be the same and blend into each other. I just commented out those lines, and now it looks fine.

its fine now

And here are the colors I changed:

colors