pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.37k stars 127 forks source link

Syntax highlighting breaks in changes in PR #442

Open hariom-qure opened 11 months ago

hariom-qure commented 11 months ago

Issue Description

bug report I'm trying to use octo and managed to get the linter working using use_local_fs=true.
but i cant see any syntax highlighting for code changes. all the text is converted to blue font.

image

Describe what happened (or what feature you want)

As you can see above, its setting all the line changes to blue font.

Describe what you expected to happen

Line changes should only have bg highlighting, the font colors should not change

How to reproduce it (as minimally and precisely as possible)

doing Octo review start on any PR is doing this

Tell us your environment

nvim --version

NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/__w/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/build/src/nvim/auto -I/__w/neovim/neovim/build/include -I/__w/neovim/neovim/build/cmake.config -I/__w/neovim/neovim/src -I/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

os

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
pwntester commented 11 months ago

This is expected, those blue lines should be your DiffAdded highlight. The problem here is that these are diff buffers so we want to both hightlight the syntax but also highlight the differences. If you dont want this behaviour you can try setting DiffAdded, DiffAdd, DiffChange, DiffDelete, etc to guifg=NONE guibg=NONE. Eg: hi DiffAdded guifg=NONE guibg=NONE

hariom-qure commented 11 months ago

But in many of your screenshots, I saw diff added with a green background, is that not the default behavior?

pwntester commented 11 months ago

That depends entirely on your theme and the highlight groups it defines for the diffXXXX groups