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

new line at end of file cause trace #1009

Open
zgpio opened this issue Apr 29, 2024 · 2 comments
Open

new line at end of file cause trace #1009

zgpio opened this issue Apr 29, 2024 · 2 comments
Labels
bug Something isn't working unable to reproduce Unable to reproduce problem

Comments

@zgpio
Copy link

zgpio commented Apr 29, 2024

Description

Description

E5108: Error executing lua: ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/popup.lua:165: {
end_col = 71,
hl_group = "GitSignsAddInline",
start_col = 69,
start_row = 2
}
Invalid 'end_col': out of range
stack traceback:
[C]: in function 'error'
...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/popup.lua:165: in function 'create_buf'
...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/popup.lua:257: in function 'create'
...l/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/actions.lua:779: in function 'f'
...l/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/actions.lua:746: in function <...l/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/actions.lua:743>

Version
035da03

Neovim version

latest

Operating system and version

Ubuntu

Expected behavior

no trace

Actual behavior

has trace

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
}

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

Steps to reproduce

  1. prepare a git file without a newline at end of file
  2. modify this file,add a new line at end of file
  3. use gitsigns show this line diff preview window

Gitsigns debug messages

No response

@zgpio zgpio added the bug Something isn't working label Apr 29, 2024
@zgpio zgpio changed the title new at end of file cause trace new line at end of file cause trace Apr 29, 2024
@lewis6991
Copy link
Owner

Please provide reproduction steps.

@lewis6991 lewis6991 added unable to reproduce Unable to reproduce problem needs response labels May 1, 2024
@zgpio
Copy link
Author

zgpio commented May 4, 2024

Please provide reproduction steps.

updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unable to reproduce Unable to reproduce problem
Projects
None yet
Development

No branches or pull requests

2 participants