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 eval_statusline to determine title width #46

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

willothy
Copy link
Contributor

@willothy willothy commented Sep 3, 2023

This PR simply changes the use of strdisplaywidth(title) to nvim_eval_statusline(title, {use_winbar=true}).width. This allows the title to work properly when set to an expression resulting in a dynamically sized string.

closes #43

@willothy willothy mentioned this pull request Sep 3, 2023
1 task
@folke folke merged commit f399e8f into folke:main Oct 13, 2023
3 checks passed
@folke
Copy link
Owner

folke commented Oct 13, 2023

Thanks!

@folke
Copy link
Owner

folke commented Oct 13, 2023

Sorry, but had to revert this change as well. My windows kept being resized when editing a buffer making Neovim unusable.

@willothy
Copy link
Contributor Author

willothy commented Oct 13, 2023

No worries, and sorry about that! Odd though, I've been using this for a while and haven't seen that issue.

Is there a better approach that could be taken for dynamic titles?

Without this, using the edgebar toggle button in the winbar will be very inconsistent as if the custom title has highlight group names, they will be included in the string so the window will often get wider or stay the same size.

@folke
Copy link
Owner

folke commented Oct 13, 2023

Would be great if you could open an issue with the edgy config and steps to reproduce. I can take a look at it then.

@willothy
Copy link
Contributor Author

Would be great if you could open an issue with the edgy config and steps to reproduce. I can take a look at it then.

Sure, I'll make a minimal init and open an issue later today :) 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.

feature: dynamic title
2 participants