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

Using keybindings for options in Gitsigns blame CR menu do nothing #1215

Closed
neanias opened this issue Feb 10, 2025 · 4 comments · Fixed by #1217
Closed

Using keybindings for options in Gitsigns blame CR menu do nothing #1215

neanias opened this issue Feb 10, 2025 · 4 comments · Fixed by #1217
Labels
bug Something isn't working

Comments

@neanias
Copy link

neanias commented Feb 10, 2025

Description

When trying to use any of the keybindings for actions in :Gitsigns blame menu, they no-op. I tried all 4 and none of them performed their options. Using the menu actions using j/k/up/down and CR work as expected.

Neovim version

NVIM v0.10.4 Build type: Release LuaJIT 2.1.1736781742

Operating system and version

macOS 15.2

Expected behavior

Expected the "show commits" to open a view of the commit.

Actual behavior

The menu closes after pressing the keybindings but nothing happens.

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
  -- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}

-- 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. touch file
  5. git add file
  6. git commit -m 'initial commit'
  7. nvim --clean -u minimal.lua file
  8. ...

Extra commits may be needed to provide enough history for git blame to display.

Gitsigns debug messages

1.07 D dprintf: Deriving GitSignsAdd from Added
1.09 D derive: Deriving GitSignsChange from Changed
1.12 D derive: Deriving GitSignsDelete from Removed
1.14 D derive: Deriving GitSignsChangedelete from GitSignsChange
1.16 D derive: Deriving GitSignsTopdelete from GitSignsDelete
1.17 D derive: Deriving GitSignsUntracked from GitSignsAdd
1.22 D derive: Deriving GitSignsAddNr from GitSignsAdd
1.24 D derive: Deriving GitSignsChangeNr from GitSignsChange
1.26 D derive: Deriving GitSignsDeleteNr from GitSignsDelete
1.27 D derive: Deriving GitSignsChangedeleteNr from GitSignsChangeNr
1.29 D derive: Deriving GitSignsTopdeleteNr from GitSignsDeleteNr
1.31 D derive: Deriving GitSignsUntrackedNr from GitSignsAddNr
1.33 D derive: Deriving GitSignsAddLn from DiffAdd
1.34 D derive: Deriving GitSignsChangeLn from DiffChange
1.36 D derive: Deriving GitSignsChangedeleteLn from GitSignsChangeLn
1.37 D derive: Deriving GitSignsTopdeleteLn from GitSignsDeleteLn
1.37 D derive: Deriving GitSignsUntrackedLn from GitSignsAddLn
1.38 D derive: Deriving GitSignsAddCul from GitSignsAdd
1.39 D derive: Deriving GitSignsChangeCul from GitSignsChange
1.40 D derive: Deriving GitSignsDeleteCul from GitSignsDelete
1.41 D derive: Deriving GitSignsChangedeleteCul from GitSignsChangeCul
1.42 D derive: Deriving GitSignsTopdeleteCul from GitSignsDeleteCul
1.43 D derive: Deriving GitSignsUntrackedCul from GitSignsAddCul
1.44 D derive: Deriving GitSignsStagedAdd from GitSignsAdd
1.45 D derive: Deriving GitSignsStagedChange from GitSignsChange
1.46 D derive: Deriving GitSignsStagedDelete from GitSignsDelete
1.47 D derive: Deriving GitSignsStagedChangedelete from GitSignsChangedelete
1.48 D derive: Deriving GitSignsStagedTopdelete from GitSignsTopdelete
1.52 D derive: Deriving GitSignsStagedUntracked from GitSignsUntracked
1.53 D derive: Deriving GitSignsStagedAddNr from GitSignsAddNr
1.56 D derive: Deriving GitSignsStagedChangeNr from GitSignsChangeNr
1.57 D derive: Deriving GitSignsStagedDeleteNr from GitSignsDeleteNr
1.58 D derive: Deriving GitSignsStagedChangedeleteNr from GitSignsChangedeleteNr
1.59 D derive: Deriving GitSignsStagedTopdeleteNr from GitSignsTopdeleteNr
1.60 D derive: Deriving GitSignsStagedUntrackedNr from GitSignsUntrackedNr
1.64 D derive: Deriving GitSignsStagedAddLn from GitSignsAddLn
1.68 D derive: Deriving GitSignsStagedChangeLn from GitSignsChangeLn
1.69 D derive: Deriving GitSignsStagedChangedeleteLn from GitSignsChangedeleteLn
1.70 D derive: Could not derive GitSignsStagedTopdeleteLn
1.71 D derive: Deriving GitSignsStagedUntrackedLn from GitSignsUntrackedLn
1.72 D derive: Deriving GitSignsStagedAddCul from GitSignsAddCul
1.74 D derive: Deriving GitSignsStagedChangeCul from GitSignsChangeCul
1.76 D derive: Deriving GitSignsStagedDeleteCul from GitSignsDeleteCul
1.77 D derive: Deriving GitSignsStagedChangedeleteCul from GitSignsChangedeleteCul
1.78 D derive: Deriving GitSignsStagedTopdeleteCul from GitSignsTopdeleteCul
1.79 D derive: Deriving GitSignsStagedUntrackedCul from GitSignsUntrackedCul
1.81 D derive: Deriving GitSignsAddPreview from DiffAdd
1.82 D derive: Deriving GitSignsDeletePreview from DiffDelete
1.83 D derive: Deriving GitSignsCurrentLineBlame from NonText
1.84 D derive: Deriving GitSignsAddInline from TermCursor
1.85 D derive: Deriving GitSignsDeleteInline from TermCursor
1.89 D derive: Deriving GitSignsChangeInline from TermCursor
1.90 D derive: Deriving GitSignsAddLnInline from GitSignsAddInline
1.91 D derive: Deriving GitSignsChangeLnInline from GitSignsChangeInline
1.92 D derive: Deriving GitSignsDeleteLnInline from GitSignsDeleteInline
1.93 D derive: Deriving GitSignsDeleteVirtLn from DiffDelete
1.95 D derive: Deriving GitSignsDeleteVirtLnInLine from GitSignsDeleteLnInline
1.96 D derive: Deriving GitSignsVirtLnum from GitSignsDeleteVirtLn
15.29 D attach(1): Attaching (trigger=BufReadPost)
15.36 D run_job: git --version
42.12 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
49.02 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /Users/willmathewson/Programming/nvim-plugins/everforest-nvim/.git config user.name
55.06 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /Users/willmathewson/Programming/nvim-plugins/everforest-nvim/.git -c core.quotepath=off ls-files --stage --others --exclude-standard --eol /Users/willmathewson/Programming/nvim-plugins/everforest-nvim/lua/everforest/highli
ghts.lua
63.56 D watch_gitdir(1): Watching git dir
63.85 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /Users/willmathewson/Programming/nvim-plugins/everforest-nvim/.git show 8a45a7067c6ddf5e887ddf4c8d53bc83f160da5a
72.84 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /Users/willmathewson/Programming/nvim-plugins/everforest-nvim/.git show HEAD:lua/everforest/highlights.lua
4409.12 D cli.run: Running action 'blame' with arguments {}
4414.81 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /Users/willmathewson/Programming/nvim-plugins/everforest-nvim/.git blame --incremental --contents - -- /Users/willmathewson/Programming/nvim-plugins/everforest-nvim/lua/everforest/highlights.lua
18247.55 D cli.run: Running action 'debug_messages' with arguments {}

Gitsigns cache

{ {
    blame = { "...",
      length = 2298
    },
    bufnr = 1,
    compare_text = { "...",
      head = "local highlights = {}",
      length = 2299
    },
    compare_text_head = { "...",
      head = "local highlights = {}",
      length = 2299
    },
    file = "/Users/willmathewson/Programming/nvim-plugins/everforest-nvim/lua/everforest/highlights.lua",
    force_next_update = false,
    git_obj = {
      encoding = "utf-8",
      file = "/Users/willmathewson/Programming/nvim-plugins/everforest-nvim/lua/everforest/highlights.lua",
      i_crlf = false,
      mode_bits = "100644",
      object_name = "8a45a7067c6ddf5e887ddf4c8d53bc83f160da5a",
      relpath = "lua/everforest/highlights.lua",
      repo = {
        abbrev_head = "main",
        detached = false,
        gitdir = "/Users/willmathewson/Programming/nvim-plugins/everforest-nvim/.git",
        toplevel = "/Users/willmathewson/Programming/nvim-plugins/everforest-nvim",
        username = "Will Mathewson"
      },
      w_crlf = false
    },
    gitdir_watcher = <userdata 1>,
    hunks = { "...",
      length = 0
    },
    hunks_staged = { "...",
      length = 0
    },
    staged_diffs = { "...",
      length = 0
    }
  } }
@neanias neanias added the bug Something isn't working label Feb 10, 2025
@lewis6991 lewis6991 added the incomplete report Instructions in issue template havent been followed label Feb 10, 2025
@lewis6991
Copy link
Owner

Ah you mean the keybindings, can reproduce. As a workaround you can use j/k to navigate the options and select with <cr>.

@neanias
Copy link
Author

neanias commented Feb 10, 2025

Ah, I didn't realise I could do that. I thought it was just using the specified keybindings. Thanks for the update!

@neanias neanias changed the title Using options in Gitsigns blame CR menu does nothing Using keybindings for options in Gitsigns blame CR menu do nothing Feb 10, 2025
@lewis6991 lewis6991 removed the incomplete report Instructions in issue template havent been followed label Feb 10, 2025
@lewis6991
Copy link
Owner

That was harder than I thought it would be. The :menu command is pretty jank.

@neanias
Copy link
Author

neanias commented Feb 11, 2025

Thanks for the fix!

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
Development

Successfully merging a pull request may close this issue.

2 participants