Skip to content

async lib update in c3070fc broke select_hunk #1223

@mmirus

Description

@mmirus

Description

After updating to c3070fc, select_hunk no longer works.

Neovim version

NVIM v0.10.2 Build type: Release LuaJIT 2.1.1713773202 Run "nvim -V1 -v" for more info

Operating system and version

NixOS 24.11

Expected behavior

Using a mapping that invokes select_hunk should work, e.g., vih should select the hunk.

Actual behavior

Nothing happens.

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
  on_attach = function(bufnr)
    local gitsigns = require('gitsigns')

    local function map(mode, l, r, opts)
      opts = opts or {}
      opts.buffer = bufnr
      vim.keymap.set(mode, l, r, opts)
    end

    -- Text object
    map({'o', 'x'}, 'ih', gitsigns.select_hunk)
  end
}

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

Steps to reproduce

  1. mkdir gitsigns_issue
  2. cd gitsigns_issue
  3. git init
  4. touch file
  5. git add file
  6. git commit -m 'initial commit'
  7. nvim --clean -u minimal.lua file
  8. Edit the file to add a changed hunk
  9. Press vih with the cursor on the hunk

Gitsigns debug messages

E5108: Error executing lua: ...gns_issue/gitsigns_issue/gitsigns/lua/gitsigns/async.lua:99: timeout must be >= 0
stack traceback:
        [C]: in function 'wait'
        ...gns_issue/gitsigns_issue/gitsigns/lua/gitsigns/async.lua:99: in function 'pwait'
        ...gns_issue/gitsigns_issue/gitsigns/lua/gitsigns/async.lua:120: in function 'wait'
        ...s_issue/gitsigns_issue/gitsigns/lua/gitsigns/actions.lua:955: in function <...s_issue/gitsigns_issue/gitsigns/lua/gitsigns/actions.lua:946>

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