Skip to content

size of hidden bottom scrollbar is not reclaimed in window size calculations #948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
masukomi opened this issue Oct 8, 2019 · 6 comments · Fixed by #1276
Closed

size of hidden bottom scrollbar is not reclaimed in window size calculations #948

masukomi opened this issue Oct 8, 2019 · 6 comments · Fixed by #1276
Labels
UI Issues related to UI elements, tabs, scrollbars, window resizing, etc.
Milestone

Comments

@masukomi
Copy link

masukomi commented Oct 8, 2019

Describe the bug
When the bottom scrollbar is toggled off. It is not possible to make a window that is as tall as the available screen real estate. You can't drag (expand) the bottom edge of the window to the bottom of the screen. If you drag the whole window down such that the bottom edge is aligned with the bottom of the screen you can't drag the top edge to expand to meet the top of the screen. The same applies to corners. It appears as if MacVim is still counting the pixels required for the scrollbar that has been hidden.

To Reproduce
Toggle the visibility of the bottom scrollbar such that it does not appear. Attempt to drag the window to meet the bottom edge of the screen. Alternately, use a window manager or anything else that can resize windows (Moom, Amethyst, etc)

Expected behavior
The window should be expandable to the full height of the screen (not counting the macOS Menu bar)

Screenshots

macvim_bottom_scrollbar_bug

Environment (please complete the following information):

MacVim about says: Custom Version 8.1.1722 (157)
macOS: 10.14.6 (18G95)

@eirnym
Copy link
Contributor

eirnym commented Oct 8, 2019

@masukomi Thank you for an issue

The size of gap is less than one symbol. MacVim tries to extend on sizes to make sure last line will be shown fully without cutting it in the middle. May be it'll change in the future.

some issues you can read about the similar requests: #273 #271 and some other you can find around.

@ychin
Copy link
Member

ychin commented Oct 22, 2019

As @eirnym said this is as designed and how GVim works. We snap the window size to the fixed intervals of the column/row size. Only time we don't do this is when the window is in fullscreen mode.

However, I do find it a little annoying. I'm considering making window size smoothly transition instead of snap to fixed interval, maybe only if set guioptions+=k is on, so I'm leaving this issue open.

@masukomi
Copy link
Author

However, I do find it a little annoying.

I use window management tools like Moom and Amethyst. When you invoke commands that are supposed to resize things and they work fine everywhere else and only mostly work here you really start scratching your head going "wtf is going on?!"

I get why it behaves the way it does, and appreciate the explanation @eirnym . From a user perspective it's just really.... weird and inconsistent.

@ychin
Copy link
Member

ychin commented Nov 3, 2019

I use window management tools like Moom and Amethyst. When you invoke commands that are supposed to resize things and they work fine everywhere else and only mostly work here you really start scratching your head going "wtf is going on?!"

That's because MacVim tells the window manager it only wants to snap to integral multiples of text size:

[decoratedWindow setContentResizeIncrements:cellSize];

You can actually remove that constraint in the code now and it would mostly work but there's still some rendering artifacts still as the draw invalidation code is a little buggy and there's another PR (#858) that may make it better. I will probably expose an option to allow smooth resizing (which will allow you to resize the window to any size) after we have fixed up the bugs (right now MacVim would occasionally clear the window when you are resizing which is annoying).

@ychin ychin added the UI Issues related to UI elements, tabs, scrollbars, window resizing, etc. label Nov 3, 2019
@ychin ychin added this to the Backlog milestone Nov 3, 2019
@9mm
Copy link

9mm commented Mar 5, 2020

@ychin that would be amazing. Do you know if that's still the plan? FWIW VimR does a really good job of this (handling the smooth resizing while still having vim interface 'snap' to the text line height). It basically creates <= 1 line of black space above the status bar, and when it gets > 1 it adds another line and goes back to <= 1 line of black space.

ychin added a commit to ychin/macvim that referenced this issue Sep 10, 2022
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 macvim-dev#948
@ychin ychin modified the milestones: Backlog, Release 174 Sep 11, 2022
@ychin
Copy link
Member

ychin commented Sep 11, 2022

It's been a while, but #1276 will now implement this feature. One thing I didn't like from other Vim GUIs like VimR and Neovide was the graphical glitches and jumpiness that happens when you live resize the window, but they are all addressed in that PR now as the CoreText renderer would extend the last column a little to the right to make it fill all the way so make it feel more stable as you resize the window.

Another PR (edit: #1280) will also make it possible to pin the cmdline to the bottom of the window because with live resizing the window size is often not directly the size of the Vim's content.

Contemplating making this the default, but will probably sleep on it a little bit first to gather feedbacks.

ychin added a commit to ychin/macvim that referenced this issue Sep 11, 2022
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 macvim-dev#948
ychin added a commit to ychin/macvim that referenced this issue Sep 11, 2022
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 macvim-dev#948
ychin pushed a commit to ychin/macvim that referenced this issue Mar 27, 2025
Problem:  "shellcmdline" completion doesn't work with input().
Solution: Use set_context_for_wildcard_arg().  Fix indent in nextwild()
          (zeertzjq).

There are some other inconsistencies for input() completion (ref macvim-dev#948),
but since "shellcmdline" currently doesn't work at all, it makse sense
to at least make it work.

fixes: #16932
closes: #16934

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Issues related to UI elements, tabs, scrollbars, window resizing, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants