Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra [No Name] buffer is created #4

Closed
RaafatTurki opened this issue Dec 11, 2022 · 2 comments
Closed

Extra [No Name] buffer is created #4

RaafatTurki opened this issue Dec 11, 2022 · 2 comments

Comments

@RaafatTurki
Copy link

RaafatTurki commented Dec 11, 2022

As the titles says a [No Name] buffer comes into existence out of thin air, I've done some debugging and arrived at resession.

The buffer is created whenever a session that was saved after a new tab has been created is loaded, which as you can imagine a situation that automates itself once auto saving sessions on quit is added

Repro

1- use the following init.lua

require "paq" {
    {'stevearc/resession.nvim'};
}

vim.o.clipboard = 'unnamedplus'
vim.o.number = true

local resession = require('resession')
resession.setup()
vim.keymap.set('n', 'sl', function() resession.load('last') end)

vim.api.nvim_create_autocmd("VimLeavePre", {
  callback = function()
    resession.save("last")
  end,
})
  1. open any file with nvim, :tabnew then :qall
  2. open nvim, sl then :ls and observe the newly created [No Name] buffer

Here's me showcasing the bug

@stevearc
Copy link
Owner

I've adjusted the default settings to skip saving empty name buffers, and fixed a bug where new-tab buffers would hang around after load. I believe that should fix this issue

@RaafatTurki
Copy link
Author

Fabulous!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants