Skip to content

staged signs no longer work for vim-fugitive index buffers #1182

@jdrouhard

Description

@jdrouhard

Description

As of commit 0edca9d, it seems like the staged signs no longer work for fugitive:// buffers (and potentially gitsigns:// buffers as well).

local rev_from_index = not git_obj:from_tree()
local buf_is_editable_file = vim.bo[bufnr].buftype == ''
if
config.signs_staged_enable
and not file_mode
and (rev_from_index or not buf_is_editable_file)
then
if not bcache.compare_text_head or config._refresh_staged_on_update then
-- When the revision is from the index, we compare against HEAD to
-- show the staged changes.
--
-- When showing a revision buffer (a buffer that represents the revision
-- of a specific file and does not have a corresponding file on disk), we
-- utilize the staged signs to represent the changes introduced in that
-- revision. Therefore we compare against the previous commit. Note there
-- should not be any normal signs for these buffers.
local staged_rev = rev_from_index and 'HEAD' or git_obj.revision .. '^'

vim.bo[bufnr].buftype is empty for these, so it looks like that new conditional is skipped since buf_is_editable_file is true.

Neovim version

NVIM v0.11.0-dev-1611+g3a25995f30

Operating system and version

RHEL 8

Expected behavior

No response

Actual behavior

No signs are placed in fugitive:// (and potentially gitsigns://) buffers.

Minimal config

If necessary, I can provide.

Steps to reproduce

Open a fugitive:// or gitsigns:// buffer (such as with :0Gclog) and notice lack of signs.

Gitsigns debug messages


Gitsigns cache

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions