Skip to content

Mini.Sessions breaks with nvim-notify #79

@kvietcong

Description

@kvietcong

Contributing guidelines

Module(s)

mini.sessions, mini.starter

Description

Here is my auto save autocommand for saving the last session automatically:

vim.api.nvim_create_autocmd("VimLeavePre", {
    callback = function() minisessions.write("LastSession.vim", {}) end
})

This works if I leave and come back using mini.starter. However, if I were to use that session and quit out again, coming back breaks it. A new empty buffer appears and every window size is severely out of proportion.

First Time Loading:
First Time Loading

Second Time Loading:
Second Time Loading

However I did find the problem. When I make nothing verbose in the config, everything works fine. Also, if I disable nvim notify, everything also works. I see in the implementation that notify is used for verbose so I'm assuming it has something to do with nvim-notify doing something weird with the buffers. Is there any way to have the verbosity with nvim notify (so that I could see when I manually save/read)?

Neovim version

0.7.0

Steps to reproduce

  1. nvim -nu minimal.lua (with nvim-notify enabled, replacing vim.notify and verbose enabled for writes)
  2. Close with auto write last session
  3. Open that session and close.
  4. Open session again.

Expected behavior

Sessions load without new buffers or weird proportion sizes.

Actual behavior

Sessions are loaded with new buffers and weird proportion sizes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions