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

Fix: Close alpha after SessionLoadPost. #267

Merged
merged 3 commits into from
Feb 25, 2024
Merged

Conversation

hoofcushion
Copy link
Contributor

@hoofcushion hoofcushion commented Feb 25, 2024

Problem:

  • Alpha use a autocmd base on BufUnload to close alpha's instance.
  • BufUnload will not be triggered by source a session file.
  • Alpha will still try to redraw after buffer closed by loading a session, causing invalid buffer error since these autocmds were not cleared properly.

Solution:

  • Add autocmd base on SessionLoadPost to close alpha after sourcing a session file.

@hoofcushion
Copy link
Contributor Author

hoofcushion commented Feb 25, 2024

Issue probably about this (invalid buffer):

Copy link
Owner

@goolord goolord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer this, if you could sanity check that this does the same thing

@hoofcushion
Copy link
Contributor Author

hoofcushion commented Feb 25, 2024

No, that's wrong, SessionLoadPost doesn't work with buffer attribute, because i tried.

@goolord
Copy link
Owner

goolord commented Feb 25, 2024

ah, weird

@goolord goolord merged commit 41283fb into goolord:main Feb 25, 2024
@goolord
Copy link
Owner

goolord commented Feb 25, 2024

ty for your contribution

@hoofcushion
Copy link
Contributor Author

hoofcushion commented Feb 25, 2024

What does ty means? try?
I am Chinese.

I asked chat gpt and it says that means "thank you". I assume it's true.

@goolord
Copy link
Owner

goolord commented Feb 25, 2024

yes, it means thank you

@jacoatvatfree
Copy link

I still get these errors from time to time when I use :Telescope oldfiles after just starting nvim with alpha as my dashboard. Seems that the events don't fire to tell alpha's autocmds to stop trying. I already configured alpha with

opts = {
    redraw_on_resize = false,
    noautocmd = true,
  }

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.

3 participants