rio icon indicating copy to clipboard operation
rio copied to clipboard

[Feature Request] Add option to center and/or stick to corner (padding-related)

Open TomLebeda opened this issue 8 months ago • 4 comments

Hello,

I would love to be able to tell Rio to re-distribute the padding so that the actual content is centered and/or sticks to some given corner.

At this moment, the default is always top-left and the left-over space is on the right and on the bottom. It can be somewhat changed using padding, but it doesn't work well (for what I want to achieve) when changing font size or window size.

If I remember correctly, Alacritty has the option to (only) center the content, which redistributes the gaps so that they are even on all sides.

In my case, I like to have zero padding and stick to bottom-left corner (which I achieved in Wezterm with custom dynamic-padding event handler).

My idea is some option in the config file named align-content (or something like that), where user could put one of center, top-left (default), top, top-right, right, bottom-right, bottom, bottom-left, left.

Anyway, thanks for your work, Rio is awesome!

TomLebeda avatar Apr 01 '25 09:04 TomLebeda

Hey @TomLebeda thanks for the issue, could you share some screenshots of how it works? In alacritty and wezterm?

raphamorim avatar Apr 14 '25 11:04 raphamorim

Hey! thanks for considering this.

Sure, here is screenshot from my Wezterm:

  • I set Wezterm's background color to be red so the padding is clearly visible against my Neovim's dark background. In other words, the red lines are the leftover space that can't fit another full cell.
  • I screenshotted the function that handles the padding re-distribution and I call this function when window is resized or when font size is changed.
  • The point is that no matter how I change font size or window size, the leftover space that can't fit another cell is all right and top, so the "content" appears to be sticking to bottom left corner. This is the behavior I want to achieve (I don't like the additional space on bottom, because in Neovim it is ugly when combined with cmdline)

Image

And here is Alacritty:

  • Again, I set the terminal background color to be red, so the padding is clearly visible.
  • Here the related option is "dynamic_padding" which re-distributes the leftover space evenly so that the content appears centered.

Image

And here is my Rio:

  • Again, the background color is set to red so it is clearly visible what is the leftover space that isn't occupied by Neovim.
  • Additionally, there is some weird padding on top, but I have all padding set to zero, as you can see in the screenshot. I don't know what is causing that, but it is persistent across all font sizes. I can somewhat get rid of it when I set padding-y to have negative values.

Side note: I also played a bit with line-height option and have found out that some values match nicely with some font sizes so that the terminal cells fill in the whole screen with no leftover space. I'm not sure how possible or difficult it would be, but having some option that would dynamically change the line height just a tiny bit (in my case, value of 1.007 was good) so that the leftover vertical space is filled by this tiny line stretch.

Image

TomLebeda avatar Apr 14 '25 11:04 TomLebeda

+1, it'd be nice to have alignment options for the padding calculation

frandmb avatar Aug 10 '25 23:08 frandmb

Man I forgot about this issue, but I will save to look. I will not fix by alignment but instead I will double the border cell so creates a filling for any case

raphamorim avatar Aug 11 '25 13:08 raphamorim