macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.47k stars 680 forks source link

Allows smooth resizing of MacVim's window #1276

Closed ychin closed 1 year ago

ychin commented 1 year ago

Adds a setting that allows for smoothly resizing the window. Previously, MacVim would only allow resizing in fixed increment of the grid size and snap to such sizes. This was a little more consistent with how terminals tend to work, and allows for optimal window sizing, and it was also an artifact of the old MacVim renderer where it didn't have a stateful renderer that could repaint the text view.

The snapping could be jarring for users more used to modern text editors which allow for smoothly resizing of the window though, and it makes third party tools that could snap macOS windows to the side not work properly as there's usually a gap near the bottom. With guioption-k, MacVim already allows for decoupling the window size from the Vim's grid size anyway, so adding smooth resizing allows to work much better under those assumptions.

In addition to allowing smooth resizing, this change also makes it so that the CoreText renderer will fill to the right a little bit when rendering the rightmost column when MacVim's window size isn't exactly the Vim grid size. Previously, if a color scheme has NonText color (e.g. desert), or the user has 'cursorline' set, smooth resize (or in full screen or guioption-k) would leave a gap to the right, looking a little ugly. This allows the last column's to fully fill to the right, resulting in a much more consistent look when resizing the window.

Close #948

ychin commented 1 year ago

Capture of smooth resizing in action below. You can see that the 'cursorline' that's active and the NonText highlight portion below don't show a gap to the right due to the right filling logic added to the CoreText renderer:

https://user-images.githubusercontent.com/1217449/189505959-81eb7b89-74ef-409e-8115-a64ddd7148be.mov

ychin commented 1 year ago

I'm contemplating turning this on by default, but maybe I'll wait a bit to sleep on it and to see if there are any feedbacks on this feature.See #1277.

9mm commented 1 year ago

Duuuude this is amazing. Wow I never thought this would become reality. (I have used MacVim for what feels like almost 10 years.. maybe its more like 8).

How do I actually turn it on?

9mm commented 1 year ago

As a sidenote, how do I actually download this pre-release dmg?

ychin commented 1 year ago

To turn it on you would need to go to Preferences and then just turn on smooth resizing.

As a sidenote, how do I actually download this pre-release dmg?

There is no way to download pre-release dmg for now. I thought about it before but decided not to pursue it at the moment due to the limited use I would imagine it gets. You could build it youself if you want to. There should be a release within September though so you should see it soon!

9mm commented 1 year ago

Awesome! thank you