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: use %{%} expr to get window for winbar eval #55

Closed
wants to merge 1 commit into from

Conversation

willothy
Copy link
Contributor

@willothy willothy commented Oct 13, 2023

Solution to what #47 attempted. When using %{%} nvim temporarily sets the current window so we can make use of the api to ensure we're always getting the correct window instead of relying on a number passed in on creation.

This partially solves the dynamic title issue as well because people can just incorporate %!v:lua.edgy_winbar() into their own winbars without worrying about what window is being evaluated. It doesn't deal with the width issue though.

@folke
Copy link
Owner

folke commented Oct 13, 2023

ok, now I understand what you want to achieve.

Shouldn't it be local win = vim.g.statusline_winid instead though?

@folke
Copy link
Owner

folke commented Oct 13, 2023

Also, feel free to remove that adding of win as a parameter.

@willothy
Copy link
Contributor Author

willothy commented Oct 13, 2023

ok, now I understand what you want to achieve.

Shouldn't it be local win = vim.g.statusline_winid instead though?

Not sure, I'll try that! The temporary variables are a bit confusing to me (not sure when they're set and when they're not), get_current_win definitely works though.

@willothy
Copy link
Contributor Author

Nope, g:statusline_winid seems to be nil

@folke folke closed this in 2a5133c Oct 14, 2023
@folke
Copy link
Owner

folke commented Oct 14, 2023

I changed the code so that it no longer requires passing win.

@willothy
Copy link
Contributor Author

Thanks!

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