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

bug: gitsigns.nvim makes Neovim randomly freeze when scrolling/switching buffers #1029

Closed
pidgeon777 opened this issue Jun 4, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@pidgeon777
Copy link

pidgeon777 commented Jun 4, 2024

Description

Occasionally, while scrolling or switching between buffers, Neovim unexpectedly becomes unresponsive. When this happens, I am forced to manually terminate the nvim.exe process.

This behavior started manifesting approximately two weeks ago.

Neovim version

NVIM v0.10.0

Operating system and version

Windows 11 Version 23H2

Expected behavior

No freezes should occur.

Actual behavior

Neovim freezes when randomly scrolling and switching buffers.

Minimal config

I can't reproduce it with this basic config:

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/LazyVim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Instead, I'm able to reproduce it using the plugin directly in LazyVim.

But, if I disable gitsigns.nvim in LazyVim using this plugin spec:

return {
  {
    "lewis6991/gitsigns.nvim",
    enabled = false,
  },
}

then everything works fine, with no freezes.

Steps to reproduce

  1. Install basic LazyVim distribution.
  2. Open several tabs in Neovim.
  3. Rapidly alternate between them in no particular order.
  4. Swiftly scroll through the open buffers.

Gitsigns debug messages

Can't get it, given that Neovim freezes.

@pidgeon777 pidgeon777 added the bug Something isn't working label Jun 4, 2024
@pidgeon777
Copy link
Author

Maybe it could be related to this:?

LazyVim/LazyVim#3407

#1027

@lewis6991
Copy link
Owner

Can this be reproduced without LazyVim?

I don't want to spend time debugging someone else's code.

@RichardEpure
Copy link

I also find that neovim sometimes freezes when gitsigns is enabled and you try to quit via :q or :qa. But it consistently does so when switching sessions via something like rmagatti/auto-session (can be any session plugin, I've tried multiple) from one repo to another and then trying to quit.

I'm on the same version of neovim and windows.

@pidgeon777 Do you experience the same? Curious if it's related or perhaps just a separate issue. I did try a minimal config with just gitsigns & autosession installed and the same thing happens.

@lewis6991
Copy link
Owner

Sounds the same as #1027

@lewis6991
Copy link
Owner

Is this fixed with #1031?

@pidgeon777
Copy link
Author

This:

#1031

and maybe also this?:

e31d214

seems to have solved the issue.

I also find that neovim sometimes freezes when gitsigns is enabled and you try to quit via :q or :qa. But it consistently does so when switching sessions via something like rmagatti/auto-session (can be any session plugin, I've tried multiple) from one repo to another and then trying to quit.

I'm on the same version of neovim and windows.

@pidgeon777 Do you experience the same? Curious if it's related or perhaps just a separate issue. I did try a minimal config with just gitsigns & autosession installed and the same thing happens.

I had the same issue, now seems to be solved. Are you still experiencing this?

@RichardEpure
Copy link

This:

#1031

and maybe also this?:

e31d214

seems to have solved the issue.

I also find that neovim sometimes freezes when gitsigns is enabled and you try to quit via :q or :qa. But it consistently does so when switching sessions via something like rmagatti/auto-session (can be any session plugin, I've tried multiple) from one repo to another and then trying to quit.
I'm on the same version of neovim and windows.
@pidgeon777 Do you experience the same? Curious if it's related or perhaps just a separate issue. I did try a minimal config with just gitsigns & autosession installed and the same thing happens.

I had the same issue, now seems to be solved. Are you still experiencing this?

Nope. It's fixed now for me since #1031.

@pidgeon777
Copy link
Author

Perfect. Thank you for the great fix @lewis6991! 👏

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
Development

No branches or pull requests

3 participants