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

prev_hunk doesn't work properly with the wrap flag #806

Closed
dtcyganok opened this issue Jun 5, 2023 · 0 comments · Fixed by #972 or #1002
Closed

prev_hunk doesn't work properly with the wrap flag #806

dtcyganok opened this issue Jun 5, 2023 · 0 comments · Fixed by #972 or #1002
Labels
bug Something isn't working

Comments

@dtcyganok
Copy link

Description

The prev_hunk function doesn't work properly with the wrap = true flag, if the first line has been removed. Looping with prev_hunk stops at the first line

Neovim version

0.9.1

Operating system and version

Linux (rolling)

Expected behavior

Looping with prev_hunk works through the entire buffer

Actual behavior

See the description above

Minimal config

vim.o.packpath = '/tmp/nvim/site'

local plugins = {
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/pack/test/start/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
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. nvim --clean -u minimal.lua
  2. Open a file
  3. Create a few hunks and delete the first line
  4. Try looping through the entire buffer with prev_hunk

Gitsigns debug messages

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment