Yee Cheng Chin d412800d3c Fix duplicate menu items in Window menu
Previously MacVim would see a lot of duplicate window menu items like
"Enter Full Screen" or "Tile Window to Left of Screen" when the user
toggles between two windows. This is because the `setWindowsMenu:` call
was injecting these items, but AppKit isn't smart enough to de-duplicate
them (unlike the window list at the bottom). Just fix this by making a
copy of the main menu before passing it in. This way every time we try
to set a main menu (which happens whenever we jump among Vim windows as
each Vim can have different menu items), it will be set with a fresh one
that doesn't have the injected menu items in it.

- This also requires adding a refresh functionality because
  adding/removing items to the original menu no longer get automatically
  reflected to the app since it only knows about the copied version.

Also, set NSFullScreenMenuItemEverywhere to prevent AppKit from
injecting "Enter Full Screen" items. MacVim already has similar menu
items to handle that.

Also, remove old private API call to `setAppleMenu:`. As far as I could
tell this is not useful anymore in recent macOS versions and that line
of code was written in 2008.

Fix #566, Fix #992
2020-09-20 03:59:50 -07:00
2019-11-20 22:31:13 +01:00
2020-08-15 18:55:18 +02:00

Vim - the text editor - for macOS

S
Description
Vim - the text editor - for macOS
Readme 251 MiB
Languages
Vim Script 52%
C 38.1%
Objective-C 3.1%
Roff 1.6%
Makefile 1.2%
Other 3.2%