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

:vim[grep] throws many errors and is extremely slow when searching in symlinked directories #17

Open
jamilraichouni opened this issue Oct 6, 2023 · 0 comments

Comments

@jamilraichouni
Copy link

Hi!

First I want to say thank you for this really helpful plugin (especially when combined with vim-fugitive).

When I search something recursively in Neovim 0.9.2 via the command

:vim /PATTERN/ /path/to/a/symlinked/dir/**/*

I get many E937: Attempt to delete a buffer that is in use: /some/path error messages.

When I uninstall vim-symlink the same command runs just fine and very quick.

BTW:
Installing the optional dependency moll/vim-bbye does also help. At the same time I'd be happy to avoid installing an additional plugin.

I created a Dockerfile with which one can easily reproduce the error.
To build the Docker image place a file named Dockerfile in some temp directory and run

docker build -t bug .

in that directory.

To run the Docker container run docker run --rm -it bug afterwards.

FROM fedora:38

RUN dnf install -y git neovim
RUN mkdir -p $HOME/.config/nvim/lua
RUN echo 'lua require("init")' > $HOME/.config/nvim/init.vim
RUN echo -e 'return {{"aymericbeaumet/vim-symlink"}}' > $HOME/.config/nvim/lua/plugins.lua
RUN echo -e '\
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"\n\
if not vim.loop.fs_stat(lazypath) then\n \
    vim.fn.system({\n \
        "git",\n \
        "clone",\n \
        "--filter=blob:none",\n \
        "https://github.com/folke/lazy.nvim.git",\n \
        "--branch=stable", -- latest stable release\n \
        lazypath,\n \
    })\n \
end\n \
vim.opt.rtp:prepend(lazypath)\n \
require("plugins")\n \
require("lazy").setup("plugins", {\n \
    ui = {\n \
        border = "rounded",\n \
        size = { width = 0.6, height = 0.9 },\n \
    }\n \
})\n' > $HOME/.config/nvim/lua/init.lua

RUN nvim --headless -c'Lazy sync' -c'q'
RUN ln -s /usr/share $HOME
CMD nvim -c'vim /PATTERN/ $HOME/share/**/*'

When the optional dependency moll/vim-bbye is being added (4th RUN statement below) the search runs without any error:

FROM fedora:38

RUN dnf install -y git neovim
RUN mkdir -p $HOME/.config/nvim/lua
RUN echo 'lua require("init")' > $HOME/.config/nvim/init.vim
RUN echo -e 'return {{"aymericbeaumet/vim-symlink", dependencies = {"moll/vim-bbye"}}}' > $HOME/.config/nvim/lua/plugins.lua
RUN echo -e '\
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"\n\
if not vim.loop.fs_stat(lazypath) then\n \
    vim.fn.system({\n \
        "git",\n \
        "clone",\n \
        "--filter=blob:none",\n \
        "https://github.com/folke/lazy.nvim.git",\n \
        "--branch=stable", -- latest stable release\n \
        lazypath,\n \
    })\n \
end\n \
vim.opt.rtp:prepend(lazypath)\n \
require("plugins")\n \
require("lazy").setup("plugins", {\n \
    ui = {\n \
        border = "rounded",\n \
        size = { width = 0.6, height = 0.9 },\n \
    }\n \
})\n' > $HOME/.config/nvim/lua/init.lua

RUN nvim --headless -c'Lazy sync' -c'q'
RUN ln -s /usr/share $HOME
CMD nvim -c'vim /PATTERN/ $HOME/share/**/*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant