-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add GUI option 's' to prevent resizing when tab bar is shown, vert split happens,etc #703
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
Conversation
runtime/doc/options.txt
Outdated
| 'lines' and 'columns' when showing tab page labels, | ||
| adding/removing scrollbars, etc. Instead, the behavior is | ||
| similar to when the window is maximized and will adjust | ||
| 'lines' and 'columns' to fit withint the GUI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
within (typo in the doc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Pushed a new commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On 2016-03-21, cvwillegen wrote:
In runtime/doc/options.txt:
@@ -3824,6 +3824,13 @@ A jump table for the options with a short description can be found at |Q_op|.
removing it after the GUI has started has no effect.
'go-F'
'F' Add a footer. Only for Motif. See |gui-footer|.
_'go-s'_'s' Fix GUI from resizing automatically. If set, this willprevent the GUI from resizing itself to fit the same number of'lines' and 'columns' when showing tab page labels,adding/removing scrollbars, etc. Instead, the behavior issimilar to when the window is maximized and will adjust'lines' and 'columns' to fit withint the GUI.
This isn't a fix, it's a user preference. I think "Fix" should be
changed to "Prevent".
Regards,
Gary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I really meant "fix" as in fixing in one place (since this fixes the size and prevent it from changing), rather than fixing a problem. Updated commit to have the more precise wording per your suggestion.
…els, vertical scrollbars, etc are added.
|
Pushed new commit to fix the "within" typo. |
|
Is it possible to rewrite the patch in such a way that only those who prefer to the proposed behavior are supposed to modify their Everybody knows and expects Vim behaves as such it does now, and some people are satisfied with it. If your patch is merged, Vim fails their expectation, and those who satisfied with the current behavior are forced to modify their Naturally, it is those who prefer to the proposed behavior who should/must modify their IMHO, it would be better to make the patch true backward-compatible. |
|
@nuko8 It does work the way you described? I guess I wasn't clear in my comment, but you have to manually set guioptions+=s in order to get the new behavior, hence my comment about backward compat. The change in gui.c will only be true (hence leading to the fixed GUI path) if the option is set. |
I wish I had this clarification in your first comment.
But to make this assertion hold true, the patch also changes the value of the first argument of |
|
@nuko8 Yes, sorry I should have been clearer about the change. The places where I changed Do note that changing to Edit: Long story short. I don't believe the behavior should change at all for users if they don't use the new GUI option. This is unless Vim can start and init maximized right off the bat but I don't believe that is the case anywhere. Edit 2: Ah ok re-reading your comment I understand your objection. You are suggesting that I should pass in |
|
Hi, since I don't see more comments but the PR is still open, just want to ask if there's anything I need to do to make this a viable pull request? As I mentioned the behavior should be the same for any users who don't modify their vimrc's. I made sure to check how the initialization and maximize behaviors work under GTK and Windows (since these are really the only two configs affected by this change) and they behave the same as before with a normal vimrc (without the new guioption). I also fixed up all the documentation wording as suggested by reviewers. Any thoughts would be appreciated. |
|
ychin wrote:
I usually wait a little while until I hear from others. I have a large Your fault: core dumped /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \ |
|
The proposed behavior (reachable by In the meantime, are there any workarounds? |
|
Author of the patch here. I think the standard recommendations are to keep the tab bar, statusline, and scrollbar visible at all times, which will prevent the window size from jumping. You will still get an issue when doing a vertical split since it will show an additional scrollbar (unless your setting is to not show scrollbars at all time). Otherwise you can either rally to have this patch integrated or make a local fork with my patch and build it yourself so you can use this new option. |
|
Note: I decided to use "k" for "Keep the size" instead of "s" which I can't associate with what it does. |
|
The "s" just stood for "size", but "k" sounds good! |
Problem: GUI window always resizes when adding/removing a scrollbar,
toolbar, etc.
Solution: Add the 'k' flag in 'guioptions' to keep the GUI window size and
change the number of lines/columns instead. (Ychin, closes vim#703)
Problem: GUI window always resizes when adding/removing a scrollbar,
toolbar, etc.
Solution: Add the 'k' flag in 'guioptions' to keep the GUI window size and
change the number of lines/columns instead. (Ychin, closes vim/vim#703)
vim/vim@8ac4415
Problem: GUI window always resizes when adding/removing a scrollbar,
toolbar, etc.
Solution: Add the 'k' flag in 'guioptions' to keep the GUI window size and
change the number of lines/columns instead. (Ychin, closes vim/vim#703)
vim/vim@8ac4415
Starting from Windows 7, MS-Windows supports Aero Snap (and it is now called just Snap). It can snap windows on the edges of the screen. If a gVim window is snapped, and then the window size is changed by a command like `:vsp` or `:tabe`, snapping will be cancelled. This might be annoying for some people. Actually this can be avoided by setting `:set go+=k`, but this also changes the behavior when the window is not snapped. This patch detects if the gVim window is snapped, and acts like if the window is maximized. So, if the window is snapped, and even if a command like `:vsp` is executed, snapping will be kept. But if the window size is explicitly specified (e.g. `:set lines=30`), the size will be changed. Related: vim#123, vim#703, vim#2180
Currently, in Vim's GUI, if you do things like adding a new tab (which triggers the tab bar to show under default setting of "showtabline = 1"), or adding a vertical split which creates another scrollbar, the whole GUI resizes. This is because it's trying to preserve number of 'lines' and 'columns'. The only time it doesn't do that is when the window is maximized, since the GUI is fixed in place and resizable. Vim does the sensible thing and reduce or increase lines and columns to fit the UI.
I think this is a pretty annoying part of using Vim's GUI, as most modern editors never resizes itself even when you add or remove GUI elements. The editing pane just shrink to fit the UI. Also this mode currently breaks Window's aero snap left/right mode (by either pressing +/ or dragging the window to left or right edge of the desktop). This is because that mode isn't classified as "maximized" by the window manager, and Vim then tries to change its own size when adding tab bar etc.
I added a GUI option 's' to fix this behavior while maintaining backward compatibility for people who really likes how Vim preserves their fixed 60 lines and 80 columns no matter what. :)
See also:
Most recommendations just involved asking users to turn off scrollbars or turning them on permanently which seems like a subpar solution.