telescope-repo.nvim icon indicating copy to clipboard operation
telescope-repo.nvim copied to clipboard

`:bdelete` does not trigger `lcd`

Open phgz opened this issue 2 years ago • 2 comments

Good day to you,

When closing a buffer via :bdelete, the lcd command does not trigger due to the autocmd being { "BufNewFile", "BufRead" }. Would it cause problems if it were BufEnter (like as in vim-rooter) instead of BufRead?

Regards.

phgz avatar Apr 18 '23 03:04 phgz

Thanks for opening this issue!

To clarify the expected behavior here, let’s say you have two buffers, A and B. You want lcd to run in buffer B after you have :bdelete in buffer A, is that correct?

Would it cause problems if it were BufEnter (like as in vim-rooter) instead of BufRead?

I don’t think it would cause problems, that’s a good idea!

cljoly avatar Apr 19 '23 21:04 cljoly

That is exactly the expected behaviour! From what I have tried, making that change seems to be resolving the issue. I am also planning on making a PR to add a feature (switch between opened projects), which would also rely on that.

phgz avatar Apr 19 '23 23:04 phgz