Skip to content

Fix loading of sessions via select#178

Merged
olimorris merged 3 commits intomainfrom
fix/load-session-in-different-dir
Aug 16, 2025
Merged

Fix loading of sessions via select#178
olimorris merged 3 commits intomainfrom
fix/load-session-in-different-dir

Conversation

@olimorris
Copy link
Copy Markdown
Owner

Relates to issue #176

@olimorris
Copy link
Copy Markdown
Owner Author

@guru245 - Pushed another tweak.

@guru245
Copy link
Copy Markdown

guru245 commented Jun 29, 2025

@olimorris I can still see the issue #176.

@olimorris
Copy link
Copy Markdown
Owner Author

If you take the buffer delete steps out of your autocommand, can you see the session load?

@guru245
Copy link
Copy Markdown

guru245 commented Jun 29, 2025

@olimorris No, I don't

I commented out the buffer delete step as follows:

vim.api.nvim_create_autocmd('User', {
  pattern = 'PersistedTelescopeLoadPre',
  ---@diagnostic disable-next-line: unused-local
  callback = function(session)
    -- Save the currently loaded session passing in the path to the current session
    require('persisted').save { session = vim.g.persisted_loaded_session }

    -- Delete all of the open buffers
    -- vim.api.nvim_input '<ESC>:%bd!<CR>'
  end,
})

and I tried both main branch and fix/load-session-in-different-dir branch but I can still see the issue #176.

I noticed one thing is different. I don't see %bd! command.
image

It's obvious as I commented out the buffer delete step. What's interesting is we can still see the issue.

@olimorris olimorris changed the title Fix loading of sessions via Telescope or select Fix loading of sessions via select Jun 29, 2025
@olimorris olimorris merged commit d35efcc into main Aug 16, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants