Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some highlights configuration does not correctly fallback #729

Closed
Yutsuten opened this issue Jan 27, 2023 · 6 comments · Fixed by #730
Closed

Some highlights configuration does not correctly fallback #729

Yutsuten opened this issue Jan 27, 2023 · 6 comments · Fixed by #730
Labels
bug Something isn't working

Comments

@Yutsuten
Copy link

Description

The documentation says that:

  • GitSignsChangedeleteNr fallbacks to GitSignsChangeNr
  • GitSignsTopdeleteNr fallbacks to GitSignsDeleteNr
  • GitSignsUntrackedNr fallbacks to GitSignsAddNr

I do have GitSignsChangeNr GitSignsDeleteNr GitSignsAddNr setting in place, but GitSignsChangedeleteNr GitSignsTopdeleteNr GitSignsUntrackedNr are not inheriting the configuration, I have to manually set it to work.

Without extra configuration the line number is shown as if there were no changes (color does not change).

Neovim version

v0.8.2

Operating system and version

Arch Linux x86_64 6.1.7-arch1-1

Expected behavior

I expect the setting to fallback.

Actual behavior

The setting is not fallback and I have to set manually.

Minimal config

vim.o.packpath = '/tmp/nvim/site'

local plugins = {
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/pack/test/start/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
end

require('gitsigns').setup{
  debug_mode = true,
  signcolumn = false,
  numhl      = true,
}

vim.cmd([[
  highlight! link SignColumn LineNr
  highlight GitSignsAddNr ctermbg=0 ctermfg=2
  highlight GitSignsChangeNr ctermbg=0 ctermfg=3
  highlight GitSignsDeleteNr ctermbg=0 ctermfg=9
]])

Steps to reproduce

Do the following in a file managed by git and without changes:

  1. nvim --clean -u minimal.lua some_file
  2. Run :set number to show line numbers
  3. Remove the first line
  4. First line number should be the color of GitSignsDeleteNr, but it stays the same color (as if unchanged).

Do some other changes that triggers GitSignsChangedeleteNr or GitSignsUntrackedNr and see that it does not fallback.

Gitsigns debug messages

No response

@Yutsuten Yutsuten added the bug Something isn't working label Jan 27, 2023
@lewis6991
Copy link
Owner

Remove the first line

The first line uses GitSignsTopdeleteNr.

@Yutsuten
Copy link
Author

GitSignsTopdeleteNr is not set so it should fallback to GitSignsDeleteNr right?

@lewis6991
Copy link
Owner

Do you have set termguicolors=true?

@Yutsuten
Copy link
Author

No I don't.

@lewis6991
Copy link
Owner

Ok, I think it's because the fallbacks aren't defined when Gitsigns sets up its highlights.

#730 should fix it. Can you check?

@Yutsuten
Copy link
Author

That was fast! Tested #730 here, the issue has been fixed!! 👍

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants