Now support a `-IgnoreUserDefaults 1` flag that can be passed to MacVim
at launch, which would cause MacVim to open with the default settings
instead of whatever the user has previously set. This only works by
overriding the MacVim-specific application defaults, and won't affect
Sparkle settings and other macOS native ones.
Also add a new menu item / macaction to open a new Vim window in clean
mode (which would prevent loading in vimrc and plugins). It works by
launching Vim using a `--clean` flag. The alt menu would open a clean
Vim window without using defaults.vim as well for the most vanilla Vim.
Currently only added Chinese/Japanese translations for the menu items.
Users who want other languages to be localized will need to file a pull
request themselves.
This feature is useful for users, but the main reason is to serve as a
pre-requisite for adding XCTest test cases to MacVim and needing a way
to launch it in a clean and predictable way.
Currently when a user uses Sparkle updater to update, they will see the
release notes beforehand. However, if they are updating across multiple
versions, they only see the latest one. Also, if they are using
automatic update, they will not see the release notes page. Users who
get MacVim from Homebrew or manually building from source also do not
see the release notes as those mechanisms are driven from command line.
This makes it harder to communicate new features and announcements to
these users.
Add a new "What's New" page that will be automatically shown whenever
the user has updated to a new version of MacVim. The last version of
MacVIm is tracked by the MMLastUsedBundleVersion value previously added
in #1357, which allows us to detect such update no matter what
installation method was used and display a dialog box. Other than
opening at launch, the user can also open it in the Help menu, and
there's an option to make it not open at launch if it's annoying to
the user.
The release notes is served by http://macvim.org/ (done in
https://github.com/macvim-dev/macvim-dev.github.io/pull/1) so we don't
have to bundle it locally and it makes it easier to update them. MacVim
will know the request a range of release notes (if updating across
multiple versions at once) so that all new versions will be visible.
Also, fix it so that both Sparkle updater and the new What's New page
will properly be shown on top of the new MacVim window that gets opened
when MacVim is launched. Previously when we get a new update, Sparkle
frequently gets hid behind the editor window.
Add a new Vim script function `showdefinition()` that allows Vim script
to call back to macOS's data lookup feature and show the definition /
URL preview / etc for any text, at a designated row/col position. If the
row/col are not provided this function will just show it at the cursor.
Also, add a new autoload/macvim.vim for utility functions to call
showdefinition() for selected texts and the word under cursor. Make a
new right-click popup menu "Look Up" call that when there are selected
texts in visual mode to make the lookup functionality easier to access
for users without a trackpad (since Ctrl-Cmd-D is a little obscure and
unwieldy to use). For the utility functions, it was a little hard to
determine how to get the text under visual selection without yanking (we
don't want to pollute the register here), and just implemented a
function to take care of all the edge cases including visual/block/line
modes and selection=exclusive. It could be useful in other situations.
As a side refactor, change the message handler in MacVim from if/else to
switch case. In optimized builds, they both essentially optimize to the
same thing, but for debug builds, the if/else statements have to step
through one by one, and switch case just makes more sense for a giant
message ID lookup like this.
Part of Epic #1311
Apple's Korean translations contain individual "." instead of using
ellipsis, and the extraction script wasn't escapting them when using
them in `menutrans` commands. Add the escape and re-generate the Korean
menu translations.
Fix#1278
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