Commit Graph

164 Commits

Author SHA1 Message Date
Yee Cheng Chin
6128cf912b Remove fade-to-black animation for native/custom fullscreen
For native fullscreen, simply remove the custom animation as it doesn't
look good and doesn't look native. This was added back when resizing the
window rapidly would result in artifacts, but they should have all been
fixed. As such, no need to hide everything under a black fade.

For custom fullscreen, make it so that if `MMFullScreenFadeTime` is set
to 0 (which is now the default), the fading animation will simply not be
drawn as it simply flickers. Since it now defaults to 0, the user will
have to manually set this back to 0.25 to get the old functionality,
which is ok as it's somewhat a legacy feature anyway and there shouldn't
be any flickering now during the transition.

Also, update documentation on full-screen to provide more info on native
vs custom, and clean up old outdated texts.

Misc driveby fixes related to full screen:
- Robustify the Touch Bar full screen button to listen to `OptionSet`
  event which is more robust than relying on `VimResized`, which also
  didn't work when 'fuoptions' is set to nothing.
- Make MacVim handle the DidFailToEnter/ExitFullScreen events better.
  These events could fire when using native full screen while the user
  is e.g. switching space. We need to make sure to properly update the
  states when these two events happen and let Vim know what the current
  `'fullscreen'` state is so both sides are synced.
- Fix up the preferences pane's full screen buttons to not trigger
  fontPropertiesChanged which was a mistake due to copy-and-paste in
  Interface Builder.

See:
- #292 / #289 which implemented the fade effect.
2021-02-07 21:32:33 -08:00
Yee Cheng Chin
ccdf468588 Add "Release Notes" to Help menu similar to a lot of other apps
Also add translations for the new entry.
2020-12-09 05:50:42 -08:00
Yee Cheng Chin
99e9e4143e Turn on Vim menu translations and add MacVim-specific ones
Remove langmenu=none from the MacVim vimrc to enable Vim's menu
translations.

Menu cleanups:
- Remove Emoji character picker menu item as macOS already adds it
  automatically to Edit menu. No need to do that ourselves.
- Rename some menus to fit macOS more and so we can use an official
  Apple translations (e.g. Select Next Tab renamed to "Show Next Tab").

Also, modify extract-specific-localised-strings.swift for MacVim. This
sets up only the locales we need, and add a new mode to generate Vim
menu translations and can be toggled using a command-line parameter.

Vim menu translations
--------------------
Vim already has menu translations, but need to add translations for
MacVim-specific menus. Add menu translations for MacVim in a new
subfolder. Each locale has two new translation files: one with Apple
official translations extracted using the script, and the other one with
custom translations (they were mostly done by referencing existing
translations, e.g. "About MacVim").  Also added a README to try to make
it clear what's going on.
- Not all menu items are translated yet. There are a couple left (e.g.
  "Toggle Full Screen" and "Stay in Front") but for it's good for now,
  and we can add those translations in later.

MacVim xib translations
--------------------
Convert MainMenu.xib to Base localization and add per-locale strings
files. The top parts are the manually translated strings (well, mostly
from guessworks with help from Google translte), and the bottom parts
are the Apple official ones coming from the script. This mostly affects
the menu that's shown when no Vim instance is opened, and also the main
app menu called "MacVim". Other menu items when there is a window opened
use the Vim menu translations instead.

Other MacVim GUI items like preference pane are currently not localized
as those would likely need someone to go through and actually manually
translate them, and it would be tricky to keep them up to date if we
make changes, which happens from time to time.

Locales
--------------------
- No MacVim translations (Apple didn't have official translations for
  them):
    - af_af.latin1
    - eo.utf-8
    - is_is.utf-8
    - sl_si.utf-8
    - sr_rs.utf-8
- Added MacVim translations:
    - ca_es
    - cs_cz
    - da
    - de_de
    - es_es
    - fi_fi
    - fr_fr
    - hu_hu
    - it_it
    - ja
    - ko_kr
    - nl_nl
    - no_no
    - pl_pl
    - pt_br
    - pt_pt
    - ru_ru
    - sv_se
    - tr_tr
    - zh_cn
    - zh_tw

Close #776
2020-10-02 17:54:17 -07:00
Yee Cheng Chin
6dc1510930 Merge remote-tracking branch 'vim/master' 2020-09-28 12:58:15 -07:00
Bram Moolenaar
b45cd36bd9 patch 8.2.1768: cannot use the help menu from a terminal window
Problem:    Cannot use the help menu from a terminal window.
Solution:   Add ":tlnoremenu" commands. (Yee Cheng Chin, closes #7023)
2020-09-28 21:41:49 +02:00
Yee Cheng Chin
fcd5797563 Bundle vimtutor with MacVim and provide Help menu item to open it
MacVim has previously not included vimtutor, meaning the user had to
obtain it elsewhere. Change the build scripts to copy it over to the app
bundle so that it's under MacVim.app/Contents/bin just like `mvim` etc.

Also, provide a Help menu item to open vimtutor. The menu action will
also make sure to override the PATH first to prevent accidentally
opening other installed MacVim/Vim versions since vimtutor works by
searching PATH instead of explicitly passing in the Vim executable path.

Also, make all Help menu items work in terminal mode as well as an easy
fix.
2020-09-26 02:29:34 -07:00
Yee Cheng Chin
e13d237836 Touch Bar add submenu/title/emoji picker support
Can now specify submenus. E.g. TouchBar.Debugger.Run. When trying to
create a submenu it will first create a popover item and then only
create the NSButton at the leaf.

- Unfortunatley macOS currently can't do multiple levels of submenus (the
  API will allow it, but it doesn't really work), presumably for
  usability concerns. Limit it to only one level of nesting for now.

Add ability to set a title on a Touch Bar button, using `tmenu`. This
allows us to override the displayed button name, and when an icon is
specified the override name will still be shown alongside the icon.

Add emoji picker support, and add it to the list of default Touch Bar
menus. Only enable it in modes where the user is typing (insert,
command, terminal, etc).

Fixed up the internal implementation of Touch Bar management so it's
easier to add metadata to it now.

Also, add documentation.

TODO:

- Using `tmenu` after `amenu` doesn't really work (unless it's specified
  in vimrc). This is because MacVim hasn't implemented
  `gui_mch_menu_set_tip`. Should fix it by adding support for it. For
  now, the user can just call `tmenu` before `amenu`.
- Disabling menus currently just hides the menu. Since the user can
  already do `aunmenu` to hide, should change the disable behavior to
  show the button but disabled instead, similar to how toolbars and
  normal menus work.
2020-09-08 02:35:53 -07:00
Yee Cheng Chin
0b58aa150f Add terminal menu mappings for new tab/tab next/full screen menus
Vim terminals use tlmenu to specify menu items and the normal `amenu`
doesn't work. This causes functionality such as toggling full screen and
going to next/prev tab to not work in terminal mode. Fix that by adding
the proper tlmenu mapping to the appropriate items.

Fix #1045
2020-08-11 22:05:23 -07:00
ichizok
4d306060eb Merge remote-tracking branch 'vim/master' 2020-06-19 14:17:00 +09:00
Bram Moolenaar
65e0d77a66 Update runtime files 2020-06-14 17:29:55 +02:00
Yee Cheng Chin
f0d844930f Merge remote-tracking branch 'vim/master' 2020-03-29 16:35:29 -07:00
Bram Moolenaar
5908fdf72f patch 8.2.0478: new buffers are not added to the Buffers menu
Problem:    New buffers are not added to the Buffers menu.
Solution:   Turn number into string. (Yee Cheng Chin, closes #5864)
2020-03-29 20:08:45 +02:00
Yee Cheng Chin
6054e34ef9 Merge remote-tracking branch 'vim/master' 2020-03-29 05:09:53 -07:00
Bram Moolenaar
5e94a29ebb patch 8.2.0413: buffer menu does not handle special buffers properly
Problem:    Buffer menu does not handle special buffers properly.
Solution:   Keep a dictionary with buffer names to reliably keep track of
            entries.
            Also trigger BufFilePre and BufFilePost for command-line and
            terminal buffers when the name changes.
2020-03-19 18:46:57 +01:00
Yee Cheng Chin
409780536e Fixing buffer menu having stale items with terminal / cmdline window
Currently, when using special buffers like terminals / command-line
window / quickfix / location list, these buffers will get added to the
"Buffers" menu, but they don't get removed when the buffers are gone,
leaving stale menu items. Fix buffer menu to be more robust.

1. Currently the buffer menu works by using the buffer name to
   add/remove the entries, but it's error-prone because the buffer could
   have been renamed under-the-hood. While it uses BufFilePre/Post
   autocommands to handle normal buffer renames, it doesn't work for the
   command-line window (accessible via `q:`) which gets renamed without
   sending the autocommand. Instead, change the menus to cached a
   dictionary a bufnum -> menu name, so it will always know how to
   remove a buffer from itself.
2. Add BufFilePre/Post autocommands to command-line windows when it
   changes the buffer name to "[Command Line]".
3. Add BufFilePre/Post autocommands to terminal windows when it
   changes the buffer name to the command, e.g. "!/bin/zsh".

Either (1) or (2)+(3) will fix the issue, but just doing all of them as
this seems like the right thing to do (2 + 3) also means the menu items
show the correct names instead of just saying "[No Name]".

This doesn't fix the following which needs to be fixed later:
1. Quickfix and Location List don't send BufDeleted autocmds. This leads
   to them also leaving stale buffer menu items as there's no way for
   the script to know that those buffers are gone.

Also add unit tests for cmdline-win / terminal buffer menus

Note: This fix misc test_cmdline failures in MacVim due to the menu item
not being able to be removed.

This is a duplicate of vim/vim#5787
2020-03-16 01:18:26 -07:00
Yee Cheng Chin
e24c70d598 Add option to disable Touch Bar default fullscreen toggle button
Add new global var g:macvim_default_touchbar_fullscreen that can disable
the fullscreen Touch Bar button. Add documentation as well.

Fix #997.
2020-03-01 03:17:23 -08:00
Yee Cheng Chin
7b64f50d01 Merge remote-tracking branch 'vim/master' 2020-01-14 08:52:44 -08:00
Bram Moolenaar
e24c5b3332 patch 8.1.2416: loading menus sets v:errmsg
Problem:    Loading menus sets v:errmsg.
Solution:   Avoid setting v:errmsg and add a test for that. (Jason Franklin)
2019-12-10 22:11:53 +01:00
Yee Cheng Chin
171784f486 Merge remote-tracking branch 'vim/master' 2019-11-17 21:33:12 -08:00
Bram Moolenaar
5ef1c6a483 Update runtime files 2019-11-10 22:09:11 +01:00
Yee Cheng Chin
8eea335f95 Merge remote-tracking branch 'vim/master' 2019-09-30 03:25:15 -07:00
Bram Moolenaar
5be4ceecea Update runtime files. 2019-09-27 19:34:08 +02:00
Yee Cheng Chin
97af264c9a Merge remote-tracking branch 'vim/master' 2019-09-23 02:38:23 -07:00
Bram Moolenaar
30e9b3c425 Update runtime files 2019-09-07 16:24:12 +02:00
Yee Cheng Chin
b87cb34cde Merge remote-tracking branch 'vim/master' 2019-02-03 21:05:54 -08:00
Bram Moolenaar
314dd79cac Update runtime files. 2019-02-03 15:27:20 +01:00
Yee Cheng Chin
b3907e6722 Make Cmd-E work and always share to OS Find Pasteboard
Cmd-E (Edit -> Use Selection for Find") in most macOS apps follow the
convention that it shares to the system Find Pasteboard, while Cmd-G
uses the Find Pasteboard to find the next item. Make Cmd-E always do
that even if MMShareFindPboard is set to NO. This way, normal searches
in Vim wouldn't pollute the system find pasteboard, but could still have
a way to share to it by using this action.
2018-11-18 21:04:41 -08:00
Yee Cheng Chin
3df190c296 Fix MMShareFindPboard not working properly and update docs
MMShareFindPboard is supposed to prevent MacVim from updating the system
find pasteboard when searching, but the previous behavior was that it
would only set the Vim-specific format to the find pasteboard so you
could still share search patterns across Vim windows but it has the
effect of clearing the global find pasteboard. Just fix that by making
MacVim not touch the system find pasteboard at all when
MMShareFindPboard is set to NO to respect user's wish. Cmd-G will still
use the system find pasteboard to make it easy to search in another
macOS program and jump to Vim. The user can always use `n` instead if
that's not desired.

Also update docs to make this clear, and rename all "OS X" to "macOS" to
keep up with the times.

Close #773
2018-11-18 21:03:05 -08:00
Kazuki Sakamoto
93d7fe4bd5 Merge remote-tracking branch 'vim/master' 2018-10-23 21:32:59 -07:00
Bram Moolenaar
4c5d815256 patch 8.1.0487: no menus specifically for the terminal window
Problem:    No menus specifically for the terminal window.
Solution:   Add :tlmenu. (Yee Cheng Chin, closes #3439) Add a menu test.
2018-10-19 22:36:53 +02:00
Kazuki Sakamoto
ba7f8db26d Merge remote-tracking branch 'vim/master' 2018-08-28 19:38:47 -07:00
Bram Moolenaar
fc65cabb15 Update runtime files. 2018-08-28 22:58:02 +02:00
Yee Cheng Chin
e1bc03b773 Touch Bar add documentation, support enabled states, and system icons
Enabled states now work. E.g. a mapped Touch Bar button using "vmenu
TouchBar.DoStuff <nop>" will not show up in normal mode.

Also support specifying default Apple template icons. E.g. "an
icon=NSTouchBarListViewTemplate TouchBar.ShowList <Nop>"

Remove default TouchBar buttons as there were too many of them and most
of them are unlikely to be heavily used as there are direct Vim command
equivalent. Instead just add a single fullscreen toggle button. This can
be changed later.
2018-07-29 01:02:11 -07:00
Christoph Walcher
8fc72761a5 basic touchbarsupport 2018-07-26 22:05:04 -07:00
Kazuki Sakamoto
2aea7468fe Merge remote-tracking branch 'vim/master' 2018-07-23 17:35:04 -07:00
Bram Moolenaar
68f1b1b37f patch 8.1.0207: need many menu translation files to cover regions
Problem:    Need many menu translation files to cover regions.
Solution:   When there is no region match, try without. (Christian Brabandt)
2018-07-23 05:10:14 +02:00
Kazuki Sakamoto
91dcb1fa63 Merge remote-tracking branch 'vim/master' 2018-07-08 19:12:27 -07:00
Bram Moolenaar
6dc819b129 Updated runtime and language files. 2018-07-03 16:42:19 +02:00
Kazuki Sakamoto
0db36ff4a2 Merge remote-tracking branch 'vim/master' 2018-05-17 19:17:47 -07:00
Bram Moolenaar
7c63fbc46e Updated runtime files. 2018-05-17 13:15:23 +02:00
Kazuki Sakamoto
75c538530a Merge remote-tracking branch 'vim/master' 2017-11-09 23:53:43 -08:00
Kazuki Sakamoto
26de87631d Revert "Add Edit > Color Scheme > Find More Color Schemes."
This reverts commit 04d045a60f.
It will cause merge conflict.
2017-11-09 23:52:49 -08:00
Bram Moolenaar
040c1feb21 patch 8.0.1279: initializing menus can be slow
Problem:    Initializing menus can be slow, especially when there are many
            keymaps, color schemes, etc.
Solution:   Do the globbing for runtime files lazlily. (Ken Takata)
2017-11-09 19:45:48 +01:00
Morton Fox
677802357a Fix for menu not found: Tools.Spelling.To Next error 2017-03-06 17:15:14 -05:00
Kazuki Sakamoto
fbe364d061 Merge remote-tracking branch 'vim/master' 2017-03-05 21:29:31 -08:00
Bram Moolenaar
214641f77d Runtime file updates. 2017-03-05 17:04:09 +01:00
Kazuki Sakamoto
170f2f4598 Merge remote-tracking branch 'vim/master' 2017-02-22 18:43:24 -08:00
Bram Moolenaar
3df0173fa6 Updated runtime files. 2017-02-17 22:47:16 +01:00
Yousef El-Zebdeh
1e3514c02e Renamamed methods and inteface labels
Stay On Bottom > Stay in Back
Stay On Top > Stay in Front
These fit closer to Apple's terminology as seen with iOS simulator.
2017-01-05 06:24:09 +00:00
Yousef El-Zebdeh
263115a528 Three window level actions
Added three window level functions to MMAppController. These allow the
window to float on top, stay on bottom or revert back to normal status.

I have also added the commands to the Actions.plist. The commands were
added using the menu.vim file.
2017-01-05 02:40:56 +00:00