lewis6991 / gitsigns.nvim

Git integration for buffers
MIT License
4.86k stars 186 forks source link

staged changes do not use the signs used in config #1076

Closed matthis-k closed 1 month ago

matthis-k commented 1 month ago

Description

when staging changes the signs used are the default ones

Neovim version

0.10

Operating system and version

nixos

Expected behavior

use the signs specified in the config

Actual behavior

image

the git diff inside this repo:

diff --git a/home-manager/nvim/config/lua/plugins/ui/gitsigns.lua b/home-manager/nvim/config/lua/plugins/ui/gitsigns.lua
index 819273b..f9c08c7 100644
--- a/home-manager/nvim/config/lua/plugins/ui/gitsigns.lua
+++ b/home-manager/nvim/config/lua/plugins/ui/gitsigns.lua
@@ -18,9 +18,9 @@ return {
         },
         opts = {
             signs = {
-                add = { text = " a" },
-                change = { text = " c" },
-                delete = { text = " d" },
+                add = { text = " A" },
+                change = { text = " C" },
+                delete = { text = " D" },
                 topdelete = { text = " t" },
                 changedelete = { text = " C" },
                 untracked = { text = " u" },

Minimal config

for name, url in pairs {
    gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
    -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} do
    local install_path = vim.fn.fnamemodify('gitsigns_issue/' .. name, ':p')
    if vim.fn.isdirectory(install_path) == 0 then
        vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
    end
    vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup {
    debug_mode = true, -- You must add this to enable debug messages
    signs = {
        add = { text = " a" },
        change = { text = " c" },
        delete = { text = " d" },
        topdelete = { text = " t" },
        changedelete = { text = " C" },
        untracked = { text = " u" },
    },
    signcolumn = true,
}

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. mkdir gitsigns_issue
  2. cd gitsigns_issue
  3. git init
  4. echo line 1\nline 2\nline 3\nline 4 > file
  5. git add file
  6. nvim --clean -u minimal.lua file

Gitsigns debug messages

No response

Gitsigns cache

No response

lewis6991 commented 1 month ago

https://github.com/lewis6991/gitsigns.nvim/blob/main/doc%2Fgitsigns.txt#L569