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

#1680 : Safety when window is closed during ReloadTabStatus reload loop #1681

Merged
merged 2 commits into from Feb 22, 2021

Conversation

ianhomer
Copy link
Contributor

Candidate fix for #1680

@tpope
Copy link
Owner

tpope commented Feb 20, 2021

This looks to me like it could still fail if you have 2 status windows open in the same tab. My preferred solution would be to change to a while loop, so that tabpagewinnr(tab, '$') is recomputed each time.

let winnr = 1
while winnr <= tabpagewinnr(tab, '$')
  " ...
  let winnr += 1
endwhile

There's still an edge case in that we could silently skip over a second status window if it moves out from under us, but I'm willing to live with that.

A true fix would utilize get_winid() to get a persistent reference to each window, but I'd rather wait till after dropping Vim 7 compatibility to roll that out.

@ianhomer
Copy link
Contributor Author

ianhomer commented Feb 21, 2021

Yep - that's better. I've updated branch as you suggest and verified it fixes issue described in #1680

@tpope tpope merged commit 6c4c7c9 into tpope:master Feb 22, 2021
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.

None yet

2 participants