astrocommunity icon indicating copy to clipboard operation
astrocommunity copied to clipboard

edgy-nvim causes crashes on <leader>-e

Open Sacro opened this issue 8 months ago • 17 comments

Checklist

  • [x] I have searched through the AstroNvim documentation
  • [x] I have searched through the existing issues of this project
  • [x] I have searched the existing issues of plugins related to this issue
  • [x] I can replicate the bug with the minimal repro.lua provided below

Neovim version (nvim -v)

NVIM v0.11.0

Operating system/version

Linux

Terminal/GUI

Wezterm

Describe the bug

Pressing leader-e to open the explorer causes nvim to quit

Steps to Reproduce

Add

{ import = "astrocommunity.split-and-window.edgy-nvim" },

to community.lua then press leader+e a few times to toggle the sidebar

Expected behavior

It doesn't crash

Screenshots

No response

Additional Context

No response

Minimal configuration

-- 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" },
  { "AstroNvim/astrocommunity" },
  { import = "astrocommunity.split-and-window.edgy-nvim" },

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

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

Sacro avatar Apr 01 '25 22:04 Sacro

Any additional info you can provide? Logs? Errors? Stacktraces? Also provide the output of nvim -v.

Uzaaft avatar Apr 09 '25 06:04 Uzaaft

Cant reproduce locally with the repro.lua

Uzaaft avatar Apr 16 '25 08:04 Uzaaft

Hey, I am able to reproduce with repo.lua after hitting <space>-e 3 times in a row (so open, close then open again) so might be worth trying. Sadly, I could not find any logs with any further information.

From experimentation, it seems to be caused by the neo-tree value within opts.left so I was able to fix locally by removing it e.g.:

  {
    "folke/edgy.nvim",
    opts = function(_, opts)
      opts.left = {
        {
          title = "Files",
          ft = "neo-tree",
          filter = function(buf) return vim.b[buf].neo_tree_source == "filesystem" end,
          pinned = true,
          open = "Neotree position=left filesystem",
          size = { height = 0.5 },
        },
        {
          title = "Buffers",
          ft = "neo-tree",
          filter = function(buf) return vim.b[buf].neo_tree_source == "buffers" end,
          pinned = true,
          open = "Neotree position=top buffers",
        },
        -- "neo-tree",
      }
    end
  },

WilfSilver avatar May 02 '25 11:05 WilfSilver

Still cant reproduce, even if I spam <leader>e for a while while using the repro.lua. Using neovim 0.10.2

Uzaaft avatar May 02 '25 11:05 Uzaaft

Using neovim 0.10.2

Yeah, I've just downgraded my neovim to 0.10.4, and now I can't reproduce the issue, so I'm guessing it's going to be a weird edge case with neovim 0.11, potentially a bug within edgy.nvim itself.

I shall see if I can try to narrow it down further this afternoon

WilfSilver avatar May 02 '25 11:05 WilfSilver

Still cant reproduce, even if I spam e for a while while using the repro.lua. Using neovim 0.10.2

You need to spam leader-e

Sacro avatar May 02 '25 11:05 Sacro

Using neovim 0.10.2

Yeah, I've just downgraded my neovim to 0.10.4, and now I can't reproduce the issue, so I'm guessing it's going to be a weird edge case with neovim 0.11, potentially a bug within edgy.nvim itself.

I shall see if I can try to narrow it down further this afternoon

Perhaps its neovim 0.11. Let mw install and check on it.

Uzaaft avatar May 02 '25 11:05 Uzaaft

Still cant reproduce, even if I spam e for a while while using the repro.lua. Using neovim 0.10.2

You need to spam leader-e

Read my message again.

Uzaaft avatar May 02 '25 11:05 Uzaaft

Still cant reproduce, even if I spam e for a while while using the repro.lua. Using neovim 0.10.2

You need to spam leader-e

Read my message again.

I have, you've said you spammed e, I said to spam leader-e.

Sacro avatar May 02 '25 11:05 Sacro

Ah. typo. I was spamming leader E.

Uzaaft avatar May 02 '25 11:05 Uzaaft

(Oh wait lol. github isnt showing <leader> correctly since I forgot the codeblock. (Fixed, marking the messages as offtopic)

Uzaaft avatar May 02 '25 11:05 Uzaaft

Yes, me too with neovim 0.11.1 Got a crash with <leader>e

MrMic avatar May 05 '25 19:05 MrMic

Still cant reproduce with 0.11.1 and repro.lua. @azdanov Can you reproduce this?

Neovim info:

NVIM v0.11.1
Build type: Release
LuaJIT 2.1.1744318430

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.11.1/share/nvim"

Run :checkhealth for more info

Uzaaft avatar May 06 '25 09:05 Uzaaft

It crashed on Linux (CachyOS):

❯ nvim -V1 -v
NVIM v0.11.1
Build type: RelWithDebInfo
LuaJIT 2.1.1741730670
Compilation: /usr/bin/cc -march=native -O3 -pipe -fno-plt -fexceptions     -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security     -fstack-clash-protection -fcf-protection -mpclmul -g1 -ffile-prefix-map=/startdir/src=/usr/src/debug/neovim -flto=auto -O2 -g -flto=auto -fno-fat-lto-objects -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fsigned-char -fstack-protector-strong -Wno-conversion -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always  -DUNIT_TESTING -D_GNU_SOURCE -DINCLUDE_GENERATED_DECLARATIONS -DUTF8PROC_STATIC -I/usr/include/luajit-2.1 -I/usr/include -I/startdir/src/neovim/build/src/nvim/auto -I/startdir/src/neovim/build/include -I/startdir/src/neovim/build/cmake.config -I/startdir/src/neovim/src 

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

~I'll check on macOS.~ On macOS 15.4.1 it doesn't crash:

❯ nvim -V1 -v
NVIM v0.11.1
Build type: Release
LuaJIT 2.1.1744318430

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.11.1/share/nvim"

Run :checkhealth for more info

azdanov avatar May 07 '25 04:05 azdanov

When I press <leader>e I got this error:

Image

MrMic avatar May 07 '25 13:05 MrMic

@MrMic Does it crash neovim for you, or only logs this error?

For me it crashes completely.

azdanov avatar May 07 '25 15:05 azdanov

@azdanov Yes, it crashes most of the time, and like the above example, it just reports error. Weird...

MrMic avatar May 07 '25 18:05 MrMic