j-morano / buffer_manager.nvim

A simple plugin to easily manage Neovim buffers.
MIT License
232 stars 12 forks source link

switch buffer based on bufnr instead of name #19

Closed noamkadosh closed 1 year ago

noamkadosh commented 1 year ago

Hi! First of all, thank you for such a wonderful plugin!

I encountered this problem where filenames that contain characters such as "[" or "]" throw an error when trying to navigate to them (e.g files in Next.js with use file based routing).

 Error 00:33:27 msg_show.lua_error E5108: Error executing lua .../nvim/lazy/buffer_manager.nvim/lua/buffer_manager/ui.lua:400: nvim_exec(): Vim(buffer):E94: No matching buffer for pages/[ToDo].tsx stack traceback: [C]: in function 'cmd' .../nvim/lazy/buffer_manager.nvim/lua/buffer_manager/ui.lua:400: in function 'nav_file' .../nvim/lazy/buffer_manager.nvim/lua/buffer_manager/ui.lua:338: in function 'select_menu_item' [string ":lua"]:1: in main chunk

Adjusting the :buffer command to navigate based on buffer number instead of name should solve the issue.

Any feedback would be much appreciated!

j-morano commented 1 year ago

Hello. Glad that you liked the plugin! Thank you very much for your contribution. It is looking good to me. I will merge the PR.