bug(neogit): jump to file is not working in CommitView #83

Closed
opened 2026-09-21 18:12:02 +00:00 by barrettruth · 4 comments
Owner

Original issue: barrettruth/diffs.nvim#186
Original author: achmutov
Original date: 2026-03-11T15:56:07Z

Prerequisites

Neovim version

NVIM v0.11.4
Build type: Release
LuaJIT 2.1.1731601260
Run "nvim -V1 -v" for more info

Operating system

Gentoo Linux x86_64

Description

Feature, introduced in NeogitOrg/neogit#930, is not working when corresponding integration is enabled. When pressing <cr> on a hunk line in CommitView, nothing happens.

This might be caused by vim.b.neogit_disable_hunk_highlight option. If set to true (which diffs.nvim does set), then line_hl of HunkLine is not set, which later prevents the line to be considered as jumpable.

Revisions:

  • diffs.nvim - de04381298483ab914759c5bf2fa277ae36ce457
  • neogit - 21f2f4e0aa655a21ea123f9509586260926cf8f2

Steps to reproduce

  1. Open NeogitLogView by executing :Neogit log and pressing l
  2. Navigate to a commit with j/k
  3. Choose the commit with <cr>
  4. Navigate to a line within a hunk with j/k
  5. Press <cr>

Expected: Neogit opens virtual file
Actual: nothing happens

Health check

==============================================================================
diffs:                                                                      ✅

diffs.nvim ~
- ✅ OK Neovim 0.9.0+ detected
- ✅ OK vim-fugitive detected
- libvscode_diff not found (optional, using native vim.diff fallback)

Minimal reproduction

vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()
require('lazy').setup({
  spec = {
    { 'barrettruth/midnight.nvim', lazy = false, config = function() vim.cmd.colorscheme('midnight') end },
    { 'NeogitOrg/neogit', dependencies = { 'nvim-lua/plenary.nvim' } },
    {
      'barrettruth/diffs.nvim',
      init = function()
        vim.g.diffs = {
          debug = '/tmp/diffs.log',
          integrations = {
            neogit = true,
          },
        }
      end,
    },
  },
})
> Original issue: barrettruth/diffs.nvim#186 > Original author: `achmutov` > Original date: 2026-03-11T15:56:07Z ### Prerequisites - [x] I have searched [existing issues](https://github.com/barrettruth/diffs.nvim/issues) - [x] I have updated to the latest version ### Neovim version ```text NVIM v0.11.4 Build type: Release LuaJIT 2.1.1731601260 Run "nvim -V1 -v" for more info ``` ### Operating system Gentoo Linux x86_64 ### Description Feature, introduced in NeogitOrg/neogit#930, is not working when corresponding integration is enabled. When pressing `<cr>` on a hunk line in `CommitView`, nothing happens. This might be caused by `vim.b.neogit_disable_hunk_highlight` option. If set to `true` (which `diffs.nvim` [does set](https://github.com/barrettruth/diffs.nvim/blob/de04381298483ab914759c5bf2fa277ae36ce457/lua/diffs/init.lua#L1022)), then `line_hl` of [HunkLine](https://github.com/NeogitOrg/neogit/blob/21f2f4e0aa655a21ea123f9509586260926cf8f2/lua/neogit/buffers/common.lua#L55-L81) is not set, which later [prevents](https://github.com/NeogitOrg/neogit/blob/21f2f4e0aa655a21ea123f9509586260926cf8f2/lua/neogit/buffers/commit_view/init.lua#L216-L220) the line to be considered as jumpable. Revisions: * `diffs.nvim` - `de04381298483ab914759c5bf2fa277ae36ce457` * `neogit` - `21f2f4e0aa655a21ea123f9509586260926cf8f2` ### Steps to reproduce 1. Open `NeogitLogView` by executing `:Neogit log` and pressing `l` 2. Navigate to a commit with `j`/`k` 3. Choose the commit with `<cr>` 4. Navigate to a line within a hunk with `j`/`k` 5. Press `<cr>` Expected: `Neogit` opens virtual file Actual: nothing happens ### Health check ```text ============================================================================== diffs: ✅ diffs.nvim ~ - ✅ OK Neovim 0.9.0+ detected - ✅ OK vim-fugitive detected - libvscode_diff not found (optional, using native vim.diff fallback) ``` ### Minimal reproduction ```lua vim.env.LAZY_STDPATH = '.repro' load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))() require('lazy').setup({ spec = { { 'barrettruth/midnight.nvim', lazy = false, config = function() vim.cmd.colorscheme('midnight') end }, { 'NeogitOrg/neogit', dependencies = { 'nvim-lua/plenary.nvim' } }, { 'barrettruth/diffs.nvim', init = function() vim.g.diffs = { debug = '/tmp/diffs.log', integrations = { neogit = true, }, } end, }, }, }) ```
barrettruth 2026-09-21 18:12:02 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

Original comment: barrettruth/diffs.nvim#186, comment 4040496218
Original author: barrettruth
Original date: 2026-03-11T16:32:52Z

looking at this now; thanks for comprehensive issue filing.

> Original comment: barrettruth/diffs.nvim#186, comment 4040496218 > Original author: `barrettruth` > Original date: 2026-03-11T16:32:52Z looking at this now; thanks for comprehensive issue filing.
Author
Owner

Original comment: barrettruth/diffs.nvim#186, comment 4040641512
Original author: barrettruth
Original date: 2026-03-11T16:53:04Z

Closing this as I am addressing it upstream.

> Original comment: barrettruth/diffs.nvim#186, comment 4040641512 > Original author: `barrettruth` > Original date: 2026-03-11T16:53:04Z Closing this as I am addressing it upstream.
Author
Owner

Original comment: barrettruth/diffs.nvim#186, comment 4040748649
Original author: barrettruth
Original date: 2026-03-11T17:09:23Z

Hello, this is now tracked here.

Please keep an eye on it and update neogit, as I will probably forget to remind you.

Thanks for reporting the issue!

> Original comment: barrettruth/diffs.nvim#186, comment 4040748649 > Original author: `barrettruth` > Original date: 2026-03-11T17:09:23Z Hello, this is now tracked [here](https://github.com/NeogitOrg/neogit/pull/1913). Please keep an eye on it and update neogit, as I will probably forget to remind you. Thanks for reporting the issue!
Author
Owner

Original comment: barrettruth/diffs.nvim#186, comment 4040793328
Original author: achmutov
Original date: 2026-03-11T17:16:55Z

Thanks for your prompt fix, awesome plugin btw!

> Original comment: barrettruth/diffs.nvim#186, comment 4040793328 > Original author: `achmutov` > Original date: 2026-03-11T17:16:55Z Thanks for your prompt fix, awesome plugin btw!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
barrettruth/diffs.nvim#83
No description provided.