bug: contextual diffs worse than isolated #168

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

Original issue: barrettruth/diffs.nvim#386
Original author: barrettruth
Original date: 2026-06-10T05:19:46Z

Prerequisites

Neovim version

a

Operating system

a

Description

Image

why is this worse than isolated

Steps to reproduce

Health check


Minimal reproduction

local host_data_site = vim.fn.stdpath('data') .. '/site'
local root = vim.fn.fnamemodify('.repro', ':p')
vim.fn.mkdir(root, 'p')
vim.env.XDG_CONFIG_HOME = root
vim.env.XDG_DATA_HOME = root
vim.env.XDG_STATE_HOME = root
vim.env.XDG_CACHE_HOME = root

local data_site = vim.fn.stdpath('data') .. '/site'
vim.fn.mkdir(data_site, 'p')
vim.opt.packpath:prepend(data_site)
if vim.uv.fs_stat(host_data_site) then
  vim.opt.runtimepath:append(host_data_site)
end

vim.o.background = 'dark'
vim.cmd.colorscheme('habamax')

vim.g.diffs = {
  debug = '/tmp/diffs.log',
  integrations = {
    fugitive = true,
    neogit = true,
    gitsigns = true,
    committia = true,
    telescope = true,
  },
}

local plugins = {
  { name = 'vim-fugitive', src = 'https://github.com/tpope/vim-fugitive' },
  { name = 'plenary.nvim', src = 'https://github.com/nvim-lua/plenary.nvim' },
  { name = 'neogit', src = 'https://github.com/NeogitOrg/neogit' },
  { name = 'gitsigns.nvim', src = 'https://github.com/lewis6991/gitsigns.nvim' },
  { name = 'committia.vim', src = 'https://github.com/rhysd/committia.vim' },
  { name = 'telescope.nvim', src = 'https://github.com/nvim-telescope/telescope.nvim' },
  { name = 'diffs.nvim', src = 'https://github.com/barrettruth/diffs.nvim' },
}

local uv = vim.uv or vim.loop

local function clone(src, path)
  if uv.fs_stat(path) then
    return
  end
  vim.fn.mkdir(vim.fn.fnamemodify(path, ':h'), 'p')
  local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', src, path })
  if vim.v.shell_error ~= 0 then
    error(out)
  end
end

if vim.pack then
  vim.pack.add(vim.tbl_map(function(plugin)
    return { src = plugin.src, name = plugin.name }
  end, plugins), { confirm = false })
else
  for _, plugin in ipairs(plugins) do
    local path = data_site .. '/pack/repro/start/' .. plugin.name
    clone(plugin.src, path)
    vim.opt.runtimepath:prepend(path)
  end
end

require('gitsigns').setup()
require('neogit').setup({})
> Original issue: barrettruth/diffs.nvim#386 > Original author: `barrettruth` > Original date: 2026-06-10T05:19:46Z ### 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 a ``` ### Operating system a ### Description <img width="499" height="350" alt="Image" src="https://forge.barrettruth.com/attachments/951b95b3-53ae-48e8-8d7b-5c7fb34fb9c5" /> why is this worse than isolated ### Steps to reproduce 1. 2. 3. ### Health check ```text ``` ### Minimal reproduction ```lua local host_data_site = vim.fn.stdpath('data') .. '/site' local root = vim.fn.fnamemodify('.repro', ':p') vim.fn.mkdir(root, 'p') vim.env.XDG_CONFIG_HOME = root vim.env.XDG_DATA_HOME = root vim.env.XDG_STATE_HOME = root vim.env.XDG_CACHE_HOME = root local data_site = vim.fn.stdpath('data') .. '/site' vim.fn.mkdir(data_site, 'p') vim.opt.packpath:prepend(data_site) if vim.uv.fs_stat(host_data_site) then vim.opt.runtimepath:append(host_data_site) end vim.o.background = 'dark' vim.cmd.colorscheme('habamax') vim.g.diffs = { debug = '/tmp/diffs.log', integrations = { fugitive = true, neogit = true, gitsigns = true, committia = true, telescope = true, }, } local plugins = { { name = 'vim-fugitive', src = 'https://github.com/tpope/vim-fugitive' }, { name = 'plenary.nvim', src = 'https://github.com/nvim-lua/plenary.nvim' }, { name = 'neogit', src = 'https://github.com/NeogitOrg/neogit' }, { name = 'gitsigns.nvim', src = 'https://github.com/lewis6991/gitsigns.nvim' }, { name = 'committia.vim', src = 'https://github.com/rhysd/committia.vim' }, { name = 'telescope.nvim', src = 'https://github.com/nvim-telescope/telescope.nvim' }, { name = 'diffs.nvim', src = 'https://github.com/barrettruth/diffs.nvim' }, } local uv = vim.uv or vim.loop local function clone(src, path) if uv.fs_stat(path) then return end vim.fn.mkdir(vim.fn.fnamemodify(path, ':h'), 'p') local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', src, path }) if vim.v.shell_error ~= 0 then error(out) end end if vim.pack then vim.pack.add(vim.tbl_map(function(plugin) return { src = plugin.src, name = plugin.name } end, plugins), { confirm = false }) else for _, plugin in ipairs(plugins) do local path = data_site .. '/pack/repro/start/' .. plugin.name clone(plugin.src, path) vim.opt.runtimepath:prepend(path) end end require('gitsigns').setup() require('neogit').setup({}) ```
barrettruth 2026-09-21 18:12:49 +00:00
  • closed this issue
  • added the
    bug
    label
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#168
No description provided.