folke / edgy.nvim

Easily create and manage predefined window layouts, bringing a new edge to your workflow
Apache License 2.0
840 stars 17 forks source link

fix: use eval_statusline to determine title width #46

Closed willothy closed 12 months ago

willothy commented 1 year ago

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

folke commented 12 months ago

Thanks!

folke commented 11 months ago

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

willothy commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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!