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: redraw terminal elements on subsequent Alpha redraws #282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bezhermoso
Copy link

The alpha.term extension deletes the terminal buffer on AlphaClosed, which causes an Invalid window id: ... error when the plugin tries to redraw things. This PR makes it so that it sets the redraw option back to true when the Alpha buffer is closed. Doing it this way still avoids the infinite redraw problem that this flag was preventing.

This should solve the issue reported here: #275

@goolord
Copy link
Owner

goolord commented May 16, 2024

ah, i see the problem now, but i'm pretty sure this is like using a shotgun to kill a fly. the terminal buffer should just get redrawn when you open alpha back up

@bezhermoso
Copy link
Author

@goolord I've found that something spams the WinResized event whenever Alpha opens back up a second time, which cause Alpha to redraw over & over & over again because of this autocmd.

I cannot figure out what's causing the deluge of WinResized events though. Any ideas?

@bezhermoso
Copy link
Author

Hmm, if I disable the terminal element, then the event no longer spams. So it could be something in what the terminal element does that causes its own issue...

@bezhermoso
Copy link
Author

Hi @goolord, can you please expound on the terminal buffer should just get redrawn when you open alpha back up?

Isn't this what this PR achieves? The opt.redraw = false rightfully prevents the terminal from rerunning again during window resizes while Alpha is open, for example. In such cases the element is simply repositioned. This PR marks the element to be redrawn the next time Alpha is opened. Am I misunderstanding your ask?

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