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

Inline blame: long commit messages overwrite text #870

Closed
Proximyst opened this issue Sep 5, 2023 · 0 comments
Closed

Inline blame: long commit messages overwrite text #870

Proximyst opened this issue Sep 5, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Proximyst
Copy link

Description

When there is a long commit message, it overwrites the text of the file, as opposed to being cut off.

Neovim version

0.9.1

Operating system and version

macOS Ventura

Expected behavior

The commit message to be cut off, perhaps with ellipsis or the likes. At the very least, let the file's text to take precedence.

Actual behavior

A file with the follow contents:

The quick brown fox jumps over the lazy dog.

Committed with:

$ git commit -m "this is a very very very long git commit message that happens to be very long, as described"

Shows as such:
image

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
  current_line_blame = true,
  current_line_blame_opts = {
    virt_text_pos = 'right_align',
  },
}

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. Open a git repository with a long commit message. E.g.:
$ mkdir /tmp/test
$ cd /tmp/test
$ git init
$ echo "The quick brown fox jumps over the lazy dog." >hello
$ git add hello
$ git commit -m "this is a very very very long git commit message that happens to be very long, as described"
  1. nvim --clean -u minimal.lua /tmp/test/hello
  2. Make the window smaller, if need be.

Gitsigns debug messages

signs.init: Using vimfn signs
dprintf: Deriving GitSignsAdd from DiffAdd
dprintf: Deriving GitSignsChange from DiffChange
dprintf: Deriving GitSignsDelete from DiffDelete
dprintf: Deriving GitSignsChangedelete from GitSignsChange
dprintf: Deriving GitSignsTopdelete from GitSignsDelete
dprintf: Deriving GitSignsUntracked from GitSignsAdd
dprintf: Deriving GitSignsAddNr from GitSignsAdd
dprintf: Deriving GitSignsChangeNr from GitSignsChange
dprintf: Deriving GitSignsDeleteNr from GitSignsDelete
dprintf: Deriving GitSignsChangedeleteNr from GitSignsChangeNr
dprintf: Deriving GitSignsTopdeleteNr from GitSignsDeleteNr
dprintf: Deriving GitSignsUntrackedNr from GitSignsAddNr
dprintf: Deriving GitSignsAddLn from DiffAdd
dprintf: Deriving GitSignsChangeLn from DiffChange
dprintf: Deriving GitSignsChangedeleteLn from GitSignsChangeLn
dprintf: Deriving GitSignsUntrackedLn from GitSignsAddLn
dprintf: Deriving GitSignsStagedAdd from GitSignsAdd
dprintf: Deriving GitSignsStagedChange from GitSignsChange
dprintf: Deriving GitSignsStagedDelete from GitSignsDelete
dprintf: Deriving GitSignsStagedChangedelete from GitSignsChangedelete
dprintf: Deriving GitSignsStagedTopdelete from GitSignsTopdelete
dprintf: Deriving GitSignsStagedAddNr from GitSignsAddNr
dprintf: Deriving GitSignsStagedChangeNr from GitSignsChangeNr
dprintf: Deriving GitSignsStagedDeleteNr from GitSignsDeleteNr
dprintf: Deriving GitSignsStagedChangedeleteNr from GitSignsChangedeleteNr
dprintf: Deriving GitSignsStagedTopdeleteNr from GitSignsTopdeleteNr
dprintf: Deriving GitSignsStagedAddLn from GitSignsAddLn
dprintf: Deriving GitSignsStagedChangeLn from GitSignsChangeLn
dprintf: Could not derive GitSignsStagedDeleteLn
dprintf: Deriving GitSignsStagedChangedeleteLn from GitSignsChangedeleteLn
dprintf: Could not derive GitSignsStagedTopdeleteLn
dprintf: Deriving GitSignsAddPreview from DiffAdd
dprintf: Deriving GitSignsDeletePreview from DiffDelete
dprintf: Deriving GitSignsCurrentLineBlame from NonText
dprintf: Deriving GitSignsAddInline from TermCursor
dprintf: Deriving GitSignsDeleteInline from TermCursor
dprintf: Deriving GitSignsChangeInline from TermCursor
dprintf: Deriving GitSignsAddLnInline from GitSignsAddInline
dprintf: Deriving GitSignsChangeLnInline from GitSignsChangeInline
dprintf: Deriving GitSignsDeleteLnInline from GitSignsDeleteInline
dprintf: Deriving GitSignsDeleteVirtLn from DiffDelete
dprintf: Deriving GitSignsDeleteVirtLnInLine from GitSignsDeleteLnInline
dprintf: Deriving GitSignsVirtLnum from GitSignsDeleteVirtLn
attach(1): Attaching (trigger=setup)
run_job: git --version
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 config user.name
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /Users/mariellh/t/.git -c core.quotepath=off ls-files --stage --other
s --exclude-standard --eol /Users/mariellh/t/hello
watch_gitdir(1): Watching git dir
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /Users/mariellh/t/.git show :0:hello
update(1): updates: 1, jobs: 5
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /Users/mariellh/t/.git blame --contents - -L 1,+1 --line-porcelain /U
sers/mariellh/t/hello
cli.run: Running action 'debug_messages' with arguments {}
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
1 participant