Skip to content

Some highlights configuration does not correctly fallback #729

@Yutsuten

Description

@Yutsuten

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions