nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.72k stars 455 forks source link

fix: use larger ft icon when coloring applied #1172

Closed ribru17 closed 4 months ago

ribru17 commented 6 months ago

This PR adds a space after the filetype icon before the highlight is applied, meaning that the space after the icon will also get the same foreground highlight as the icon itself, allowing the icon to take its proper full width on most (all?) terminal emulators. Users of vim-devicons or users who set the icon highlight to false will have the same experience as before. Examples: Before: lualinebeforelua After: lualineafterlua Before: lualinebeforerust After: lualineafterrust

zuqini commented 4 months ago

Just wanted to follow up on this PR and ask if there's anything additional we can do to help get it merged in.

I've been looking forward to this fix but the PR seems to have lost some traction. Appreciate the hard work!

ribru17 commented 4 months ago

@shadmansaleh Do you need any extra work to be done on this?

shadmansaleh commented 4 months ago

Looks good to me.

However, it doesn't make the icons bigger for me. what terminal are you using? Is this specific to vim-devicons? I have nvim-devicons and am using kitty.

Though, I don't see much downside to adding a space to icons if it makes it better for some people.

ribru17 commented 4 months ago

Interesting... I use kitty as well and I have to say the effect is much more noticeable on wezterm. Especially with the Rust icon (but this is a separate issue, nvim-devicons uses a Rust icon that kitty renders very small for some reason). That being said, for me on kitty it looks like the icons are slightly larger with this change

EDIT: I think I was wrong, and kitty does indeed already do this. However on wezterm the effect is quite noticeable

shadmansaleh commented 4 months ago

So kitty already renders the icon in full size and on wezterm it requires an extra space is that what you're saying?

ribru17 commented 4 months ago

Basically yes; or rather, they both require an extra space behind the icon (unless you set a special setting in kitty), but Wezterm isn't smart enough to recognize that the icon should be full width if the empty space after the icon has a different foreground color (even though it is just an empty space). This PR moves the space so it is applied before the foreground color changes, allowing Wezterm and similar terminals to recognize that the icon should be full-width

shadmansaleh commented 4 months ago

Then it's ok to merge this change. Thanks for your contribution.

vurtune commented 3 months ago

I think this space may be optional in config, because some users use mono font, like me, no extra space needed. 20240326_020431 Extra space showed in red.

You can use extra space in padding to any component, by the way

Julpikar commented 1 week ago

its look too many space if setting with just only icon or icon in right position. for wezterm small rendered icon issue, i have found this issue.

small rendered font: https://github.com/wez/wezterm/issues/342 probably fix: https://wezfurlong.org/wezterm/config/lua/config/allow_square_glyphs_to_overflow_width.html