Description
Steps to reproduce
I am building MacVim from git source pretty regularly with huge features enabled on Catalina (macOS 10.15.7) with XCode 12.1 and Ventura (macOS 13.2.1) with XCode 14.1.
I have the following code in my .gvimrc that enters full screen in diff mode and equalizes the sizes of side by side windows:
au VimEnter,VimResized * :call MaximizeWindowInDiffMode()
function MaximizeWindowInDiffMode()
" if the GUI was started in the diff mode, maximize the window
if &diff
color github
" make all windows equal width
execute "normal \<C-w>="
" turn off transparency since colors look better
set transparency=0
" enter full screen
if !&fu
set fu
endif
endif
endfunction
This used to work for over 15 years now, until it got broken very recently. It works fine in MacVim r176, patch level 1298:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Feb 19 2023 09:57:09)
macOS version - x86_64
Included patches: 1-1298
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +find_in_path +mouse_xterm -tcl
+arabic +float +multi_byte +termguicolors
+autocmd +folding +multi_lang +terminal
+autochdir -footer -mzscheme +terminfo
-autoservername +fork() +netbeans_intg +termresponse
+balloon_eval +fullscreen +num64 +textobjects
+balloon_eval_term +gettext +odbeditor +textprop
+browse -hangul_input +packages +timers
++builtin_terms +iconv +path_extra +title
+byte_offset +insert_expand +perl +toolbar
+channel +ipv6 +persistent_undo +transparency
+cindent +job +popupwin +user_commands
+clientserver +jumplist +postscript +vartabs
+clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap +python/dyn +viminfo
+cmdline_info +libcall +python3/dyn +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
+cscope +localmap +ruby +wildignore
+cursorbind +lua +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con_gui +mksession +smartindent +writebackup
+diff +modify_fname +sodium -X11
+digraphs +mouse +sound -xfontset
+dnd +mouseshape +spell +xim
-ebcdic +mouse_dec +startuptime -xpm
+emacs_tags -mouse_gpm +statusline -xsmp
+eval -mouse_jsbterm -sun_workshop -xterm_clipboard
+ex_extra +mouse_netterm +syntax -xterm_save
+extra_search +mouse_sgr +tag_binary
-farsi -mouse_sysmouse -tag_old_static
+file_in_path +mouse_urxvt -tag_any_white
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -I/usr/local/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o Vim -lm -lncurses /usr/local/lib/libsodium.a -liconv /usr/local/lib/libintl.a -framework AppKit -L/usr/local/lib -llua -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -lruby.2.6 -L/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
but stops working in patch level 1365.
Note that it works on Ventura but not on Catalina.
On Catalina you get erratic behavior where once in a while it will enter the full screen mode, but most of the time it will not.
Note that the function is always called (tested it with debug messages) and the fullscreen mode is set :set fu?
prints fullscreen
.
Of course you could solve this problem but not using VimEnter event at all and just entering full screen mode always in diff mode, but the full screen behaviour is quite jarring and not smooth.
Expected behaviour
MacVim should enter full screen mode.
Version of Vim and architecture
9.0.1365 x86_64
Environment
macOS 10.15.7
mac Terminal.app
xterm-256color
GNU bash, version 5.2.15(1)-release (x86_64-apple-darwin19.6.0)
How MacVim was installed
Built form git
Logs and stack traces
No response
Vim configuration where issue is reproducable
No response
Issue has been tested with given configuration
- by running MacVim.app from GUI macOS interface
- by running vim/gvim/etc installed by MacVim
- by running other versions of vim (e.g. /usr/bin/vim)
Issue has been tested with no configuration
- by running
mvim --clean
(orgvim
, supplied by MacVim distribution) - by running
vim --clean
(in terminal, supplied by MacVim distribution) - by running
vim --clean
(in terminal, other suppliers, e.g. /usr/bin/vim)
Other conditions
- The both Homebrew packages "vim" and "macvim" are installed