bug: highlight in filenames with - (fugitive) #179

Closed
opened 2026-09-21 18:13:13 +00:00 by barrettruth · 1 comment
Owner

Original issue: barrettruth/diffs.nvim#423
Original author: SebasF1349
Original date: 2026-07-22T20:16:59Z

Prerequisites

Neovim version

NVIM v0.13.0-dev-1092+gada2007453
Build type: RelWithDebInfo
LuaJIT 2.1.1784360928
Run "nvim -V1 -v" for more info

Operating system

Ubuntu wsl

Description

File that have a - in their name are (partially) highlighted in the Fugitive status buffer. This only happens when I open the diff.

Image

Steps to reproduce

  1. Make a change in a buffer with a filename containing - (in a git repository)
  2. :G (needs vim-fugitive)
  3. Toggle the diff of the file (- over the filename)

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)
- difftastic not enabled (optional, set integrations.difftastic)

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#423 > Original author: `SebasF1349` > Original date: 2026-07-22T20:16:59Z ### 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.13.0-dev-1092+gada2007453 Build type: RelWithDebInfo LuaJIT 2.1.1784360928 Run "nvim -V1 -v" for more info ``` ### Operating system Ubuntu wsl ### Description File that have a `-` in their name are (partially) highlighted in the Fugitive status buffer. This only happens when I open the diff. <img width="580" height="206" alt="Image" src="https://forge.barrettruth.com/attachments/051c80b1-20ee-441e-8bb4-fb78255735df" /> ### Steps to reproduce 1. Make a change in a buffer with a filename containing `-` (in a git repository) 2. `:G` (needs vim-fugitive) 3. Toggle the diff of the file (`-` over the filename) ### 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) - difftastic not enabled (optional, set integrations.difftastic) ``` ### 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:13:13 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

Original comment: barrettruth/diffs.nvim#423, comment 5051058380
Original author: SebasF1349
Original date: 2026-07-22T20:20:29Z

Sorry, just re-tested with the minimal reproduction and I'm not able to replicate it, so it must be something wrong with my config somehow.

> Original comment: barrettruth/diffs.nvim#423, comment 5051058380 > Original author: `SebasF1349` > Original date: 2026-07-22T20:20:29Z Sorry, just re-tested with the minimal reproduction and I'm not able to replicate it, so it must be something wrong with my config somehow.
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#179
No description provided.