Skip to content

Restoring a session containing a carbon sidebar breaks carbon #121

@dhazel

Description

@dhazel

Thanks for the great plugin!

Neovim version: 0.8.2
OS: Windows 10

Steps to reproduce:

  1. Open neovim
  2. Open the carbon sidebar, :ToggleSidebarCarbon
  3. Save the session, :mksession mysession.vim
  4. Close neovim
  5. Open neovim
  6. Restore the session, :source mysession.vim
  7. Observe that the sidebar is created but carbon does not render in the sidebar
  8. Attempt to toggle the carbon sidebar, :ToggleSidebarCarbon
  9. Observe that carbon does not render and an error is thrown in messages:
Error executing Lua callback: ...ata/Local/nvim-data/lazy/carbon.nvim/lua/carbon/util.lua:195: Vim:E95: Buffer with this name already exists
stack traceback:
	[C]: in function 'nvim_buf_set_name'
	...ata/Local/nvim-data/lazy/carbon.nvim/lua/carbon/util.lua:195: in function 'create_scratch_buf'
	...a/Local/nvim-data/lazy/carbon.nvim/lua/carbon/buffer.lua:54: in function 'handle'
	...a/Local/nvim-data/lazy/carbon.nvim/lua/carbon/buffer.lua:99: in function 'show'
	.../AppData/Local/nvim-data/lazy/carbon.nvim/lua/carbon.lua:224: in function 'explore_sidebar'
	.../AppData/Local/nvim-data/lazy/carbon.nvim/lua/carbon.lua:198: in function <.../AppData/Local/nvim-data/lazy/carbon.nvim/lua/carbon.lua:185>
Failed to run `config` for carbon.nvim

...ata/Local/nvim-data/lazy/carbon.nvim/lua/carbon/util.lua:195: Failed to rename buffer

# stacktrace:
  - carbon.nvim\lua\carbon\util.lua:195 _in_ **create_scratch_buf**
  - carbon.nvim\lua\carbon\buffer.lua:54 _in_ **handle**
  - carbon.nvim\lua\carbon\buffer.lua:99 _in_ **show**
  - carbon.nvim\lua\carbon\buffer.lua:22 _in_ **launch**
  - carbon.nvim\lua\carbon.lua:87 _in_ **initialize**
  - carbon.nvim\lua\carbon.lua:29 _in_ **setup**
E492: Not an editor command: qw

Metadata

Metadata

Assignees

Labels

bugReport or fix bugs

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions