AstroNvim / AstroNvim

AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins
https://AstroNvim.com
GNU General Public License v3.0
12.54k stars 918 forks source link

Nvim Freezes when using `gg` and other `g` prefixed keys #2659

Closed caojm closed 2 months ago

caojm commented 2 months ago

Checklist

Operating system/version

Debian12

Terminal/GUI

putty

AstroNvim Health

astronvim: require("astronvim.health").check() 3 2 AstroNvim 1 - AstroNvim Version: v4.20.0 7 - Neovim Version: v0.10.0 1 - WARNING Neovim nightly is not officially supported and may have breaking changes 2 - OK git is installed: Used for core functionality such as updater and plugin management 3 - OK xdg-open is installed: Used for gx mapping for opening files with system opener (Optional) 4 - OK rg is installed: Used for Telescope live_grep picker, fw and fW by default (Optional) 5 - OK lazygit is installed: Used for mappings to pull up git TUI (Optional) 6 - OK node is installed: Used for mappings to pull up node REPL (Optional) 7 - WARNING gdu/gdu_windows_amd64.exe is not installed: Used for mappings to pull up disk usage analyzer (Optional) 8 - OK btm is installed: Used for mappings to pull up system monitor (Optional) 9 - OK python3 is installed: Used for mappings to pull up python REPL (Optional)

Describe the bug

My AstroNvim is used for remote connection in Debian12 environment. After I upgrade to 4.20, the interface does not move after I run gg command.

Steps to Reproduce

  1. Start neovim with the repro.lua in an environment with no clipboard provider installed. Here is a simple docker command that works and mounts the repro.lua in the current directory
    docker run -v $(pwd)/repro.lua:/root/repro.lua -w /root -it --rm alpine:edge sh -uelic '
    apk add neovim alpine-sdk git curl
    nvim -u repro.lua repro.lua
    '
  2. G, go to the bottom of the file
  3. gg, go to the top of the file
  4. See that neovim has completely frozen and there is a notification regarding "no clipboard provider"

Expected behavior

Nvim does not freeze.

Screenshots

No response

Additional Context

No response

Repro

-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "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
  -- stylua: ignore
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

-- install plugins
local plugins = {
  { "AstroNvim/AstroNvim", import = "astronvim.plugins" },

  -- add any other plugins/customizations here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here (autocommands, vim.filetype, etc.)

EDIT: updated to make the issue body valid by providing proper reproducing steps

mehalter commented 2 months ago

Cannot be replicated with the minimal configuration provided so this isn't a fully formed issue. Please adhere to the checklist, it is there to guide you through if an issue is fleshed out enough to open an issue and help us help you. With the information provided, I am unable to identify if this is a bug in AstroNvim at all and am provided with nothing to turn it into an actionable item. I would recommend checking out the discord server for general questions like these so people can help you debug your configuration.

You could also drop your configuration here and if someone has time to try and dig through all your code and find this issue then they can.

If you do some debugging and identify the problem as an AstroNvim issue and reduce it down to a minimal reproducing configuration and some clear steps to replicate, please comment back here with revisions and I can reopen this!

mehalter commented 2 months ago

Another bit of guidance to investigating your problem is to use git bisect to identify a specific commit that introduces the big and then see what that commit is doing to help identify what the issue could be

caojm commented 2 months ago

I intalled a new Debian in VirtualBox. The bug appears again in Debian 12.6 with the latest upgrading.

caojm commented 2 months ago

Cannot be replicated with the minimal configuration provided so this isn't a fully formed issue. Please adhere to the checklist, it is there to guide you through if an issue is fleshed out enough to open an issue and help us help you. With the information provided, I am unable to identify if this is a bug in AstroNvim at all and am provided with nothing to turn it into an actionable item. I would recommend checking out the discord server for general questions like these so people can help you debug your configuration.

You could also drop your configuration here and if someone has time to try and dig through all your code and find this issue then they can.

If you do some debugging and identify the problem as an AstroNvim issue and reduce it down to a minimal reproducing configuration and some clear steps to replicate, please comment back here with revisions and I can reopen this!

I installed a new Debian in VirtualBox. The bug appears again in Debian 12.6 with the latest upgrading. I also installed a new Ubuntu Server in VirtualBox. The bug appears again in Ubuntu Server 2404 with the latest upgrading.

shpsyte commented 2 months ago

I can confirm the BUG, fresh install using Arch Linux, 0 extra plugins, if you just open any files and type gg astrovim gets freeze .

Actually I believe any g combination trigger this issue: gn, gf....

mehalter commented 2 months ago

Thanks for the confirmation! This has been identified as an upstream bug after some people dug into this on the Discord server: https://github.com/folke/which-key.nvim/issues/687

mehalter commented 2 months ago

In the meantime you can either install a clipboard utility (:h clipboard and :checkhealth provider.clipboard)

or add the following to your configuration:

return {
  "AstroNvim/astrocore",
  opts = {
    options = {
      opt = {
        clipboard = "",
      },
    },
  },
}
mehalter commented 2 months ago

Added the necessary information to make the issue valid above for future sake.

shpsyte commented 2 months ago

I was checking the clipboard tool and @mehalter is right

Just by adding a clipboard tool the issue does not occurs any more....

For linux (arch) I did: sudo pacman -S xclip set clipboard=unnamedplus

To test just yank a text using "+y and past it to another program...

then you can use g combination ....

mehalter commented 2 months ago

This is resolved upstream with the release of which-key v3.4