Neovide: [Feature Request] inner-padding around nvim

Created on 18 Feb 2020  路  14Comments  路  Source: Kethku/neovide

It can be nice to be able to set padding aroud nvim instance.
Here is an exemple with vim on my terminal on the right.

enhancement

All 14 comments

Correct me if I'm wrong, but this feels like a feature that should be enabled in your window manager, not the app

I don't think it should be the prerogative of the gui to add padding around windows when all other situations that is undesirable.

Hum.. I'm talking about inner-padding, but my WM is pretty minimalist, maybe you'll see my point with more decoration:
2020-02-18-192452_1920x1080_scrot

This is what I'm talking about. I don't see other apps really adding options for inner padding, and I'm concerned about the added complexity for such a niche feature.

Ho ok, sorry about that, I though you think about window borders. Well, most of the terminal I used have this options (vte-based, urxvt.. ) so I'm used to it. But you probably right, not a lot of people will need it. I'll see if I can trick my vm. Thank's for your time ! :)

Window border handling is currently all managed by the windowing system which is currently managed by winit, but moving to sdl2 since winit appears to be buggy in a few crucial ways. I'm actually going to reopen this as a future enhancement, but at the moment it is going to be very low priority :( If done in an unobtrusive way I would be happy to take a pull request, but I'd probably be pretty picky about much added complexity since its just a few of us managing the project :)

I did a quick experiment, and submitted my WIP to this branch: https://github.com/Kethku/neovide/tree/window-margin-experiment
It is very broken right now, but it shows a few issues we'd have to solve to fully implement this.

This is how it looks right now on Linux (Sway window manager), with a huge black margin:
Screenshot_2020-03-01_16-03-1583077228

Issues I've found:

  • Right now nvim tells us to what color clear the background of each cell. But does it tell us what color to use for areas that have no cell attached? Right now we're not clearing that, and it just accumulates garbage over time
  • Changing the margin in runtime can result in horrible visual artifacts, as some parts realize there's been a margin change and others don't. Not sure exactly where that's coming from right now.
  • Sometimes the previous issue happens on startup too. My guess is the settings sometimes load after the window is created, and then it behaves like a runtime change.
  • The cursor misaligns when adding the margin. I tried just offsetting the cursor by the margin, but it seems to have also made each cursor cell bigger than the actual text cells. No idea why.

I'm going to close this as out of scope. I think this adds too much complexity for a niche use case

@jonvaldes I tried to do the same based on your fork with the little changes and got pretty nice results. No glitches, margin have proper background color, pointer positioning is absolutely OK, mouse position is handled correctly and it feels like complexity of the code is almost not increased. I'm new to Rust, I will refactor my code a bit later and try to prepare a good PR for review.

This is how it looks at the moment on Linux:
Neovid-margins

Gui's on macOS (and I assume windows) can't take advantage of padding through the WM/compositor, since yabai etc. doesn't support it. I understand its outside the scope of neovim, but could you kindly reconsider opening the issue?

Done. However I think its pretty low priority unless somebody wants to take it on.

@zezic do you mind sharing your WIP code?

@shaunsingh It seems like I deleted it from my disk. It was mostly based on this commit: https://github.com/Kethku/neovide/commit/c376629b17a089c77bcff0ba405a5af96123e7ee
If I remember correctly, there were much additions in the main repo after that, many of them included various changes related to multigrid feature. Probably, this is why I decided that it will be easier to rewrite the feature from scratch.

No problem. Alacritty has a similar option so I'll take a look at both.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

habamax picture habamax  路  67Comments

svermeulen picture svermeulen  路  26Comments

wbthomason picture wbthomason  路  35Comments

shaunsingh picture shaunsingh  路  27Comments

IBS27 picture IBS27  路  29Comments