mrquantumcodes / bufferchad.nvim

A simple yet powerful buffer management system
GNU General Public License v3.0
41 stars 0 forks source link

Buffer is not 'modifiable' #4

Closed stephanmeesters closed 8 months ago

stephanmeesters commented 8 months ago

Describe the bug Error appears, see below.

To Reproduce Steps to reproduce the behavior:

  1. config

using lazy.vim

return { "mrquantumcodes/bufferchad.nvim", requires = { {"nvim-telescope/telescope.nvim"} }, config = function () require("bufferchad").setup({ mapping = "", -- Map any key, or set to NONE to disable key mapping mark_mapping = "bm", -- The keybinding to display just the marked buffers order = "LAST_USED_UP", -- LAST_USED_UP (default)/ASCENDING/DESCENDING/REGULAR style = "default" -- default, modern (requires dressing.nvim and nui.nvim), telescope (requires telescope.nvim) }) end }

  1. Open up bufferchad window with Control E
  2. Again press Control E with the bufferchad window open. The error appears

Stack trace E5108: Error executing lua: ...local/share/nvim/lazy/bufferchad.nvim/lua/bufferchad.lua:151: Buffer is not 'modifiable' stack traceback: [C]: in function 'nvim_buf_set_lines' ...local/share/nvim/lazy/bufferchad.nvim/lua/bufferchad.lua:151: in function 'OpenBufferWindow' ...local/share/nvim/lazy/bufferchad.nvim/lua/bufferchad.lua:135: in function 'BufferChadListBuffers' ...local/share/nvim/lazy/bufferchad.nvim/lua/bufferchad.lua:16: in function <...local/share/nvim/lazy/bufferchad.nvim/lua/bufferchad.lua:16>

Desktop (please complete the following information):

Additional context neovim nightly bufferchad.nvim commit ad232ad

mrquantumcodes commented 8 months ago

I have issued a new update that allows setting a close mapping in default mode with a close_mapping option. To fix your issue, you can set both the mapping and the close_mapping to Control E. Please let me know it it fixed the issue.

PS: Btw since you are using telescope, I recommend also setting the style to "telescope" so you can get the buffer list in a telescope window with preview and all that stuff. However, you currently can't change the close_mapping for the telescope window, you need to use double escape (but if you've configured telescope itself to close with a different mapping, that should work here).

stephanmeesters commented 8 months ago

Thanks setting the close_mapping to Control E fixed the issue for me

mrquantumcodes commented 8 months ago

You are welcome!