famiu/bufdelete.nvim

A strange delay when closing a buffer

lcfd opened this issue · 4 comments

lcfd commented

Hi!

Maybe it's only me but I'm experiencing a strange delay when I delete a buffer.
The usual :bdelete is much faster.

I run the command using a keystroke:

vim.keymap.set("n", "<leader>c", "<cmd>Bdelete<cr>")

Is it correct?

famiu commented

Yes, a slight delay is expected since Bdelete has to do more processing prior to invoking :bdelete but it shouldn't even be noticable. It's weird that you're seeing a delay. Do you have a lot of buffers open? Maybe a plugin is causing a lot of hidden buffers to be opened? Can you reproduce the lag with nvim --clean with just bufdelete.nvim

lcfd commented

I'll do some tests! Maybe with some usage I'll discover more.

Thank you for your time!

famiu commented

BTW, until we can find some concrete benchmarks that are consistently reproducible, I'm going to be closing this issue. Feel free to reopen if you can provide that.

@lcfd I had the same issue, turns out I had a keymap ca for code actions so it was waiting to see if I also click "a". Removing that keymap fixed the delay it's super fast now.