Skip to content

New defaults: Smoothly resize window, guioptions+=k #1528

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

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runtime/doc/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4198,6 +4198,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'guioptions' 'go' string (default "egmrLtT" (MS-Windows,
"t" is removed in |defaults.vim|),
"aegimrLtT" (GTK and Motif),
"egmrLk" (MacVim),
)
global
{only available when compiled with GUI enabled}
Expand Down
2 changes: 1 addition & 1 deletion src/MacVim/Base.lproj/Preferences.xib
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
<button id="f9h-8n-asD" userLabel="allow smooth resizing">
<rect key="frame" x="188" y="-1" width="258" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<string key="toolTip">Smoothly resizes MacVim's window instead of fixing it to the grid size. It's also recommended to set "guioptions+=k" in your vimrc when this is set.</string>
<string key="toolTip">Smoothly resizes MacVim's window instead of snapping it to increments of the cell size. It's also recommended to have "guioptions+=k" set in Vim when this is on.</string>
<buttonCell key="cell" type="check" title="Smoothly resizes window" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="4YN-AX-Vrz">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
Expand Down
2 changes: 1 addition & 1 deletion src/MacVim/MMAppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ + (void)registerDefaults
[NSNumber numberWithBool:NO], MMNonNativeFullScreenShowMenuKey,
[NSNumber numberWithInt:0], MMNonNativeFullScreenSafeAreaBehaviorKey,
[NSNumber numberWithBool:YES], MMShareFindPboardKey,
[NSNumber numberWithBool:NO], MMSmoothResizeKey,
[NSNumber numberWithBool:YES], MMSmoothResizeKey,
[NSNumber numberWithBool:NO], MMCmdLineAlignBottomKey,
[NSNumber numberWithBool:NO], MMRendererClipToRowKey,
[NSNumber numberWithBool:YES], MMAllowForceClickLookUpKey,
Expand Down
3 changes: 1 addition & 2 deletions src/MacVim/MacVimTests/MacVimTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,6 @@ - (void) fullScreenTestWithNative:(BOOL)native {

// In native full screen, non-smooth resize is more of an edge case due to
// macOS's handling of resize constraints. Set this option to exercise that.
// Also, when we are setting guifont, we don't cause it to resize the window.
[self setDefault:MMSmoothResizeKey toValue:@NO];

[self createTestVimWindow];
Expand All @@ -874,7 +873,7 @@ - (void) fullScreenTestWithNative:(BOOL)native {

const int numRows = MMMinRows + 10;
const int numColumns = MMMinColumns + 10;
[self sendStringToVim:@":set guifont=Menlo:h10\n" withMods:0];
[self sendStringToVim:@":set guioptions-=k guifont=Menlo:h10\n" withMods:0];
[self waitForEventHandlingAndVimProcess];
[self sendStringToVim:[NSString stringWithFormat:@":set lines=%d columns=%d\n", numRows, numColumns] withMods:0];
[self waitForEventHandlingAndVimProcess];
Expand Down
2 changes: 1 addition & 1 deletion src/optiondefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ static struct vimoption options[] =
#if defined(FEAT_GUI)
(char_u *)&p_go, PV_NONE, did_set_guioptions, expand_set_guioptions,
# ifdef FEAT_GUI_MACVIM
{(char_u *)"egmrL", (char_u *)0L}
{(char_u *)"egmrLk", (char_u *)0L}
# elif defined(UNIX)
{(char_u *)"aegimrLtT", (char_u *)0L}
# else
Expand Down
2 changes: 1 addition & 1 deletion src/testdir/test_gui.vim
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ func Test_set_guioptions()
elseif has('gui_macvim')
" Default Value
set guioptions&
call assert_equal('egmrL', &guioptions)
call assert_equal('egmrLk', &guioptions)

else
" Default Value
Expand Down
Loading