Updated to Vim 9.0.1677
Announcements
====================
Website
--------------------
The official website for MacVim is now https://macvim.org. Previously it just
forwarded to https://macvim-dev.github.io/macvim/. You can also read the MacVim
documentation at https://macvim.org/docs/gui_mac.txt.html. #1385
Features
====================
Updater / What's New page
--------------------
There is now a "What's New" page that will automatically be shown whenever
MacVim detected that it has been updated to a new version (can be disabled in
Settings). The page will also include all the release notes if you have
updated across multiple versions. This feature is useful for users who turned
on "Automatically install updates" or installs MacVim through other methods
like Homebrew but would still like to see the release notes when a new version
comes out. You can also access it through the Help menu. #1414
MacVim should now report its version in a much more consistent manner in the
"About MacVim" page and when the updater reports there is a new version. It
should look something like "r176 (Vim 9.0.1276)" where "r176" is the MacVim
release number and the 9.0.1276 is the bundled Vim version. #1293#1393
Sparkle (updater for MacVim) is now updated to 2.4.2. #1416
New Vim features
--------------------
- New bundled colorschemes: wildcharm/retrobox/sorbet/zaibatsu (vim/vim#12163)
- File encryption now has a new `cryptmethod`: `xchacha20v2`, which is designed
to be more forward compatible with future Vim versions than `xchacha20`.
(v9.0.1481)
- `switchbuf` works for more commands. (v9.0.1546)
- Statusline now supports multiple alignment "%=" items. (v9.0.1300)
- New UTF-16 utility functions (`strutf16len` and `utf16idx`) (v9.0.1485)
- Misc 'smoothscroll' bugs fixes
General
====================
* Removed non-Unicode localization files, which helps cut down on app size. #1397
* Miscellaneous documentation fixes. #1415#1375#1386#1363 (by @dkav)
* The disk image for MacVim (MacVim.dmg) is now in APFS and uses better
compression for better efficiency. #1409
Fixes
====================
* Printing a file in macOS 13 Ventura (using `:hardcopy` or File→Print) should
work again. #1390
* Fixed a broken symlink to XPCServices in the Sparkle framework. #1367
* Fixed MacVim to not throw (safe) Objective C exceptions when quitting. #1371
* Fixed welcome message not being aligned properly in Simplified Chinese and
show the Vim 9 prompt. #1381
* Removed some unnecessary test files in the runtime folders which were
included erroneously. #1418
Scripting
====================
- Scripting languages versions:
- Python is now built against 3.11, up from 3.10.
Compatibility
====================
Requires macOS 10.9 or above. (10.9 - 10.12 requires downloading a
separate legacy build)
Script interfaces have compatibility with these versions:
- Lua 5.4
- Perl 5.30
- Python2 2.7
- Python3 3.11
- Ruby 3.2
This cleans up some glaring ones like the syntax/indent's testdir
folders in the runtime directory. The real issue is that MacVim just
blindly copies the runtime folder to the app bundler but they should
really be "installed" using the `make install` command which properly
copies the necessary files only. See #1417 which will fix this.
Also, refactor CI configs to only specify the Python 3 and Perl versions
in one place, so we don't have to multiple lines in the config file.
Additionally, add checks to make sure the Homebrew Python 3 version
matches the configured one, so we will have a failed build and be
notified this way instead of silently building against an old version of
Python in CI, which would still work as GitHub CI has older versions of
Python installed.
Note that if https://github.com/vim/vim/pull/12032 is merged, this will
be less painful in the future as stable ABI should mean we don't have to
care as much about the exact Python version.
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.
Currently it Sparkle is disabled we remove it from the bundle. Make code
signing resilient to that. This isn't used in our CI, but useful for
testing or if some other people want to bundle MacVim without Sparkle.
Recent Vim builds introduced the use of clock_gettime(), which on macOS
was only introduced in 10.12. In Vim, we added a configure check to
detect its existence (https://github.com/vim/vim/issues/12242) but it
only works to detect the build-time environment. For MacVim builds we
build on new machines but deploy on old machines by using
MACOSX_DEPLOYMENT_TARGET=10.9 when building. This means that the
configure script will detect clock_gettime() exists and includes it, but
at runtime the app will crash when running MacVim (legacy builds) in
10.9-10.11.
To fix this, add explicit checks to make sure we undef
HAVE_CLOCK_GETTIME if deployment target is below 10.12. Unfortunately
there isn't really a way to detect such things automatically in a
configure script as it requires knowledge of historical releases.
Use newer formats for creating the DMG file for distributing MacVim.
APFS has been supported fully since macOS 10.13, and from testing it
extracts faster than HFS+.
LZFSE (ULFO format) is newer than zlib/DEFLATE (UDZO format) and also
decompresses faster as well from testing. Note that there is a newer
compression scheme using LZMA (ULMO format) but it is only supported in
10.15+ which is too high for us as non-legacy builds need to target
10.13+. Also, from testing, the newer LZMA yields smaller files, but
takes more time to decompress than LZFSE.
Also, keeping using the old formats (HFS+/zlib) for legacy builds since
they need to work on 10.9, which don't support the newer formats.
Latest version hasn't been officially released yet as they don't
frequently release new versions, so just grabbing the code.
This adds APFS support for creating DMG's.
Problem: Crash syncing swapfile in new buffer when using sodium crypt.
(James McCoy)
Solution: Add checks for sodium encryption. (Christian Brabandt,
closes#12591, closes#12585)
Problem: Empty CmdlineEnter autocommand causes errors in Ex mode.
Solution: Save and restore ex_pressedreturn. (Christian Brabandt,
closes # 12581, closes#12578)
Problem: Termdebug on MS-Windows: some file names are not recognized.
Solution: Do not always change \t and \n. (Christian Brabandt,
closes#12565, closes#12560, closes#12550)
Problem: Error for using matchfuzzy() in Vim9 script returning a list of
dicts.
Solution: Make return type of matchfuzzy() list<any>. (Yegappan Lakshmanan,
closes#12574)
Problem: Autoload files for "zig" are not installed.
Solution: Add install and uninstall rules in the makefile. (Christian
Brabandt, closes#12577, closes#12567)
Problem: Syntax test fails when detected shell type differs.
Solution: Avoid using "/bin/sh", it depends on the system. Add a check that
the shell type detection is correct.
Problem: Insufficient testing for syntax plugins.
Solution: Add shell file examples. (Charles Campbell) Create a messages
file for easier debugging and reporting the test results.
Problem: Compiler warning for uninitialized variable.
Solution: Move the variable to an inner block and initialize it. (Christian
Brabandt, closes#12549)
Problem: "make clean" at the toplevel fails.
Solution: Clean the indent and syntax directories in a sub-shell. (Ben
Jackson, closes#12536, closes#12526)
Problem: Visual area not shown when using 'showbreak' and start of line is
not visible. (Jaehwang Jung)
Solution: Adjust "fromcol" for the space taken by 'showbreak'.
(closes#12514)
Problem: FILETYPE_FILE is defined to the same value multiple times. Same
for a few similar macros.
Solution: Define FILETYPE_FILE and others in feature.h only
Problem: The focus gained/lost escape sequences cause trouble for a
terminal where Vim does not expect them.
Solution: Always recognize the codes for focus gained/lost. (closes#12499)
Problem: charidx() and utf16idx() result is not consistent with byteidx().
Solution: When the index is equal to the length of the text return the
lenght of the text instead of -1. (Yegappan Lakshmanan,
closes#12503)
Problem: Display is wrong when 'smoothscroll' is set and scrolling multiple
lines.
Solution: Redraw with UPD_NOT_VALID when "skipcol" is or was set.
(closes#12490, closes#12468)
During merging from upstream Vim, I noticed that MacVim is doing some
unnecessary clears. From looking at them, I don't think they are really
necessary (at least with the current source revision). Such
MacVim-specific changes add merge conflicts and makes it difficult to
diagnose issues (as we need to determine if they are MacVim-specific or
Vim). Just remove it for now. Can always add back if we see issues.
The change was introduced in c621846160.
Problem: screenpos() returns wrong row with diff filler lines.
Solution: Only add filler lines when appropriate. Also don't add the
'smoothscroll' marker when w_skipcol is zero. (closes#12485,
closes#12484)
Problem: Crash when calling method on super in child constructor. (Israel
Chauca Fuentes)
Solution: Clear the type list. (Ernie Rael, closes#12489, closes#12471)
Problem: Errors from the codestyle test are a bit confusing.
Solution: Use assert_report() with a clearer message. Avoid a warning for
an existing swap file.
Problem: Stray character is visible if 'smoothscroll' marker is displayed
on top of a double-wide character.
Solution: When overwriting a double-width character with the 'smoothscroll'
marker clear the second half. (closes#12469)
Problem: Filetype detection fails for *.conf file without comments.
(Dmitrii Tcyganok)
Solution: Use "conf" filetype as a fallback for an empty .conf file.
(closes#12487, closes#12483)
Problem: Cursor not adjusted when near top or bottom of window and
'splitkeep' is not "cursor".
Solution: Move boundary checks to outer cursor move functions, inner
functions should only return valid cursor positions. (Luuk van
Baal, closes#12480)
Problem: screenchar(), screenchars() and screenstring() do not work
properly when 'encoding' is set to a double-byte encoding.
Solution: Fix the way the bytes of the characters are obtained.
(issue #12469)
Problem: Some "gomod" files are not recognized.
Solution: Check for "go.mod" file name before checking out the contents.
(Omar El Halabi, closes#12462)
Problem: Incsearch not triggered when pasting clipboard register on the
command line.
Solution: Also set "literally" when using a clipboard register. (Ken Takata,
closes#12460)
Problem: Checking translations gives an error for using two messages with
ngettext() that differ in "%" items.
Solution: Adjust the check script to tolerate omitting one "%" item.
Problem: Weird use of static variables for spell checking.
Solution: Move the variables to a structure and pass them from win_update()
to win_line(). (Luuk van Baal, closes#12448)
Problem: Get E304 when using 'cryptmethod' "xchacha20v2". (Steve Mynott)
Solution: Add 4th crypt method to block zero ID check. Avoid syncing a swap
file before reading the file. (closes#12433)
Problem: :stopinsert may not work in a popup close handler. (Ben Jackson)
Solution: Restore stop_insert_mode when appropriate. (closes#12452,
closes#12434)
Problem: SpellCap highlight not always updated when needed.
Solution: Handle updating line below closed fold and other situations where
only part of the window is redrawn. (Luuk van Baal, closes#12428,
closes#12420)
Problem: MS-Windows: context menu translations may be wrong.
Solution: Set the encoding before using gettext(). (Ken Takata,
closes#12441, closes#12431)
Problem: RedrawingDisabled not used consistently.
Solution: Avoid RedrawingDisabled going negative. Set RedrawingDisabled in
win_split_ins(). (closes#11961)
Problem: Cannot use "this.member" in lambda in class method.
Solution: Adjust check for reserved keyword. (Hirohito Higashi,
closes#12416, closes#12076, closes#12336)
Problem: With 'smoothscroll' cursor may move below botline.
Solution: Call redraw_later() if needed, Compute cursor row with adjusted
condition. (Luuk van Baal, closes#12415)
Problem: Display moves up and down with 'incsearch' and 'smoothscroll'.
Solution: Do not check if w_skipcol changed. (Luuk van Baal, closes#12410,
closes#12409)
Problem: GTK3: window manager resize hints are incomplete.
Solution: Use NULL for second argument of gtk_window_set_geometry_hints().
(Kenny Stauffer closes#11055)
Problem: Display wrong when moving cursor to above the top line and
'smoothscroll' is set.
Solution: Call adjust_skipcol() in more places and make it work better.
(Luuk van Baal, closes#12395)
Problem: Win32: When 'encoding' is set $PATH has duplicate entries.
Solution: Only append the directory if it is not there yet. (Ken Takata,
closes#12400, closes#12372)
Problem: Function argument types not always checked and using v:none may
cause an error.
Solution: Check argument types once the function type is known. Do not give
an error for using v:none as an argument. (closes#12200)
Problem: Position of marker for 'smoothscroll' not computed correctly.
Solution: Take 'list' and other options into account. (Luuk van Baal,
closes#12393)
Problem: CI: check in sound-dummy module may throw an error.
Solution: Check whether apt-cache can show the package description.
(Christian Brabandt, closes#12390)
Problem: Some commands for opening a file don't use 'switchbuf'.
Solution: Use 'switchbuf' for more commands. (Yegappan Lakshmanan,
closes#12383, closes#12381)
Problem: Display errors when making topline shorter and 'smoothscroll' is
set.
Solution: Reset w_skipcol when the topline becomes shorter than its current
value. (Luuk van Baal, closes#12367)
Problem: Message for opening the cmdline window is not translated.
Solution: Add gettext() and scan the defaults script for text to be
translated. (closes#12371)
Problem: Cursor moves to wrong line when 'foldmethod' is "diff". (Rick
Howe)
Solution: Adjust logic for scrolling. (Luuk van Baal, closes#12364,
closes#12218)
Problem: Libsodium encryption is only used with "huge" features, even when
manually enabled through configure. (Tony Mechelynck)
Solution: Remove the condition on FEAT_HUGE.
Problem: 'smoothscroll' does not always work properly.
Solution: Do not reset w_skipcol after it was intentionally set. (Luuk van
Baal, closes#12360, closes#12199, closes#12323)
Problem: Search stats not always visible when searching backwards.
Solution: Do not display the top/bot message on top of the search stats.
(Christian Brabandt, closes#12322, closes#12222)
Problem: Assert message is confusing with boolean result. assert_inrange()
replaces message instead of adding it.
Solution: Don't put quotes around expected boolean value. Append message
for assert_inrange(). (closes#12342, closes#12341)
Problem: No error when calling remote_startserver() with an empty string.
Solution: Give an error for an empty string. (Hirohito Higashi,
closes#12327)
Problem: In a terminal window the cursor may jump around. (Kenny Stauffer)
Solution: Do not move the cursor to the position for terminal-normal mode.
(closes#12312)
Problem: Popup menu position wrong in window with toolbar.
Solution: Take the window toolbar into account when positioning the popup
menu. (closes#12308)
Problem: Content-type header for LSP channel not according to spec.
Solution: Use "vscode-jsonrpc" instead of "vim-jsonrpc". (Yegappan
Lakshmanan, closes#12295)
Problem: no functions for converting from/to UTF-16 index.
Solution: Add UTF-16 flag to existing funtions and add strutf16len() and
utf16idx(). (Yegappan Lakshmanan, closes#12216)
Problem: Decrypting with libsodium may fail if the library changes.
Solution: Add parameters used to the encrypted file header. (Christian
Brabandt, closes#12279)
Problem: Using popup menu may leave text in the command line.
Solution: Clear the command line if the popup menu covered it. (Luuk van
Baal, closes#12286)
Problem: Lines put in non-current window are not displayed. (Marius
Gedminas)
Solution: Don't increment the topline when inserting just above it.
(closes#12212)
Problem: Deferred functions invoked in unexpected order when using :qa and
autocommands.
Solution: Call deferred functions for the current funccal before using the
stack. (closes#12278)
Problem: Recursively calling :defer function if it does :qa in a compiled
function.
Solution: Clear the defer entry before calling the function. (closes#12271)
Problem: Cannot use an object member name as a method argument.
Solution: Do not give an error for using an object member name for a method
argument. (Hirohito Higashi, closes#12241, closes#12225)
Fix line number for other argument error.
Problem: Virtual text truncation only works with Unicode 'encoding'.
Solution: Convert the ellipsis character to 'encoding' if needed. (Hirohito
Higashi, closes#12233)
Problem: Ruler not drawn correctly when using 'rulerformat'.
Solution: Adjust formatting depending on whether the ruler is drawn in the
statusline or the command line. (Sean Dewar, closes#12246)
Problem: Crash when passing NULL to setcmdline(). (Andreas Louv)
Solution: Use tv_get_string() instead of using v_string directly.
(closes#12231, closes#12227)
Problem: .fs files are falsely recognized as forth files.
Solution: Check 100 lines for something that looks like forth. (Johan
Kotlinski, closes#12219, closes#11988)
Problem: Scrolling too many lines when 'wrap' and 'diff' are set.
Solution: Only scroll by screenlines for 'diff' when 'wrap' is not set.
(closes#12211)
Problem: Cursor in wrong position when leaving insert mode.
Solution: Update the w_valid flags. Position the cursor also when not
redrawing. (closes#12137)
Problem: Indent wrong after "export namespace" in C++.
Solution: Skip over "inline" and "export" in any order. (Virginia Senioria,
closes#12134, closes#12133)
Currently a lot of the .po locale files are generated using iconv to
different encodings. This is only necessary if the version of Vim does
not have iconv and cannot dynamically convert encoding, which isn't the
case for MacVim. Furthermore, MacVim should only work in UTF-8 anyway,
so it's not useful to have all the other non-UTF-8 locales (e.g.
zh_CN.cp936.po) being built and bundled together, as they make the build
process more complicated and bulk up the binary size of the app bundle.
Simply modify the Makefile to not install / build any of the duplicate
locale files. For locales like ko/zh_CN/zh_TW, where the "base" version
ko.po is in a non-UTF-8 locale and converted from a ko.UTF-8.po, we keep
only the ko.UTF-8.po version, but during install we install the folder
as "ko" instead of "ko.UTF-8". This way, if someone somehow set
LANG=ko_KR, it will still work instead of having to set
LANG=ko_KR.UTF-8.
Currently, pl.po is an odd one out because pl.UTF-8.po is actually
generated from pl.po, instead of the other way round. We just use pl.po
since that's the source version, instead of using the generated UTF-8
one for simplicity (MacVim can handle it fine).
Also, revert the MacVim-local translations made to these non-UTF8
locales like zh_CN.cp936.po, since we don't use them anymore in MacVim
builds.
Saved ~2 MB in the app bundle, and ~1MB in the generated dmg.
Sparkle 2.4 added support for customizing the displayed version string
instead of just showing the "display version" from the manifest (see
https://github.com/sparkle-project/Sparkle/issues/2267). Since MacVim
has a somewhat non-standard usage of bundle vs display version (bundle
is release number, and display version is the upstream Vim version), we
really want to show both to the user, in a concise manner. Support this
customization so it looks like "r123 (Vim 9.1.2345)" (here, "123" is the
bundle version / release number, and "9.1.2345" is the display version /
Vim version).
Fix#1293
2.3.2
- Contains a fix to prevent Sparkle (and the app) from crashing if the
appcast contains file:// or invalid URLs.
2.4
- Add ability to customize version string displays, which is useful for
MacVim as our bundle version (MacVim release number) and display
version (Vim release) are different things and we want to customize
how they are displayed.
- Sparkle binary size reduced roughly by half. This does mean it doesn't
come with debug symbols anymore so we would need to cross-correlate
with dSYM files.
This helps the user know whether they are using a relatively untested
build and should consider going back to a main release. We currently
just define "pre-release" build as any release version with a minor
version, e.g. r176.1 is a pre-release, but r176 isn't.
Also, move the order around so we show "MacVim r123 (Vim
9.0.1234)" instead of "Vim 9.0.1234 (MacVim r123)" which is more
consistent with other ways we show version numbers, and this will be
how we show version number when we upgrade to Sparkle 2.4 as well.
MacVim's `:hardcopy` implementation just uses Preview to show the
generated PostScript file and lets the user decide what to do with it.
macOS 13 Ventura removed PostScript support from Preview, so we now have
to manually convert it to PDF first using `pstopdf` (which is thankfully
bundled with macOS).
While we are at it, update the script so that we actually delete the
file after sending it to Preview. Previously MacVim never did that and
therefore leaks the file in a temp folder until Vim closes, which isn't
ideal for privacy. Now, just set a 10 sec timer to delete the file after
it's opened (we just need enough time to allow Preview to open and load
the file, which doesn't take much time. The 10 sec timer is to account
for slow computers).
Fix#1347
Turn on parallel building, to remove the "Building targets in manual
order is deprecated" project warning.
Also, fix configure to only set macOS deployment target to the major
version of macOS when automatically setting it from the client OS
version. E.g. On macOS 13.2 it will set deployment to 13.0. This is
useful because usually we don't want it to be as granular as the minor
version which had caused issues in Homebrew before
(https://github.com/Homebrew/homebrew-core/issues/111693) where they had
to fix on their end, and also 13.2 ends up being too new for Xcode which
only expects to see up to 13.1 as deployment target.
- Note that the logic used to work in OSX 10.X days because the "minor"
version of X is actually the OS version, whereas in macOS 11/12/13 we
now have versions like 13.2 where the first number is now the OS
version. The configure script will now detect whether it's 10.X.Y or
X.Y (X != 10) and set the correct target correspondingly.
Set mouseshape correctly when using 'r' or 'gr'. Otherwise Vim will only
do it when mouse moves or window receives focus, which is a little
random. This change will be ported upstream.
Part of this was originally part of #1178 but we removed the qlstephen
parts to prepare for eventual removal. Couple years later and we haven't
removed qlstephen yet, so just fix the warnings for now first.
From #1178:
- Fix the project localization name from English to "en"
- Set ALWAYS_SEARCH_USER_PATHS to "NO"
Also:
- Remove the hard-coded macOS 10.8 deployment target which actually
isn't supported by modern Xcode versions. Just unset it as our CI
usually sets that for us.
- The post-build script is now tagged properly to always run.
- Ignore all deprecation warnings. These were exposed because we removed
the 10.8 deployment target. Since we aren't going to be fixing them
(we are either just going to grab newer versions from upsteram, or
delete this), there's no point in having these warnings.
Previously MacVim started to use the latest autoconf (2.71) but it's
best to match upstream in version to make it easier to diff/merge
changes, and also because the version upgrade is technically not 100%
backwards compatible.
Add an empty implementation to remove a diff from upstream, which
constantly shows up when resolving merge conflicts. We just make the
implementation empty because we already handle mouse hide in the MacVim
process using NSCursor instead, and don't need Vim's manual handling of
it.
Also, refactor test_macvim.vim a little.
In the CI setup, xcode-select is only called after the packages have
been set up, but during setup we actually need to build the packages
from source to have the correct deployment target linked correctly. This
means we could potentially be building with the wrong configuration
(e.g. when building for 10.9 legacy builds, we could be using an Xcode
version that's too new for that) when building gettext/libsodium. This
is compounded by the fact that our GitHub Action cache key for the
libraries only include the formula, but not the active Xcode version
itself so a cache could be propagated for a while until suddenly things
break.
To fix this, first make sure we do Xcode configuration early on in the
build, and to properly use the Xcode version as part of the cache key.
This way, when Xcode version changes, we will invalidate the cache and
rebuild gettext / libsodium with the correct configuration and if that's
wrong we will immediately fail the build instead of using old stale
caches.
Also, bump Xcode from 14.1 to 14.2 in CI.
Problem: Highlight for popupmenu kind and extra cannot be set.
Solution: Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel
highlight groups and use them. (Gianmaria Bajo, closes#12114)
MacVim's docs for 'fuoptions' above didn't terminate a code block which
resulted in the 'gdefault' help tags being broken as they were treated
as code blocks as well. Fix up the docs properly.
The Chinese alignment was slightly wrong when `columns` is even
numbered. Add an additional space to make sure it will line up right.
Also, for Spanish, just fix up the text to fit how the other intro help
texts look.
Also, don't hide the `:help version9` prompt in intro. For some reason
MacVim hides that prompt and shows the `:help macvim` prompt instead
which makes no sense. Just show both.
Fix#1380
Problem: "clear" macros are not always used.
Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
places. (Yegappan Lakshmanan, closes#12104)
Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes#12109)
The recent upstream Vim merge (v9.0.1365) contained a lot of refactoring
in the option setting code. Handling option setting was now done via a
standardized callback, with a struct `optset_T`. In resolving the
upstream merge conflicts, `did_set_fullscreen` was erroneously using the
wrong value from the union (should be using boolean instead of number)
which leads to it occasionally giving unpredictable results. Fix the
bug.
Note that the bug seems a little unpredictable since it depends on
compiler specifics. The only way it was known to trigger was by `set
diff` followed by `set fullscreen`.
Fix#1378
GitHub has a security tab that allows repos to manage their security
policy so it's not a bad idea ot be explicit in expectations. The policy
is to either use GitHub's builtin reporting system, or email MacVim's
team (in case that's the preferred method or the reporter does not want
to have a GitHub account). The most important thing is to not use the
public GitHub issue filing.
I don't think this will be used too much, but given that MacVim (and
Vim) can read arbitrary file, there is always a potential for a security
issue to pop up.
Problem: Function for setting options not used consistently.
Solution: Use a function for 'encoding' and terminal options. (Yegappan
Lakshmanan, closes#12099)
Problem: Wrong text displayed when using both 'linebreak' and 'list'.
Solution: Only set "c_extra" to NUL when "p_extra" is not empty. (Hirohito
Higashi, closes#12065)
Problem: Still some "else if" constructs for setting options.
Solution: Add a few more functions for handling options. (Yegappan
Lakshmanan, closes#12090)
Add "MACVIM REFERENCE" to syntax rule to reflect the new header to make
it look less weird. Also remove the "last changed date" header since I
rarely update it and it's not particularly useful given how in MacVim
the runtime is always bundled anyway.
Also, when investigating using Neovim's treesitter vim docs generating
tool for MacVim (to generate a web version of the documentation), found
a few typos / formatting issues. Fix them here.
Make sure to block testing 'winaltkeys' only if the option is supported.
Also, while we are at it, add a test to make sure MacVim-specific
options have proper error checking to prevent bad merge conflict
resolution from accidentally removing said logic.
With the release of Homebrew 4, auto-update is supposed to be more
efficient now. By removing the HOMEBREW_NO_AUTO_UPDATE env var from CI,
this will make sure that all the packages that we link to in CI will be
up to date instead of whatever just happens to be installed on the CI
environment which can sometimes fluctuate.
Previously, when configured with `--disable-sparkle`, the
Sparkle.framework would still get linked and copied into the app bundle.
This is because Xcode doesn't have an easy way to disable individual
build phase. We would either have to make a new build target, or
dynamically patch the project file in order for that to not happen.
Package managers like Homebrew and Nix have to either manually delete
the framework as a post-build step, or manually patch the pbxproj file
as a pre-build step to make sure the framework never got linked/copied.
Also, when building MacVim on macOS 10.9-10.12, where Sparkle 2 is not
supported, even if you build with `--disable-sparkle`, the app still
wouldn't run since Sparkle 2's framework still got copied into the app
and on launch the OS will detect that it's not compatible with the OS
version.
To fix this, just add a new env var and have the build cleanup script
delete the entire Sparkle.framework as a post-build step, if
`--disable-sparkle` was previously configured.
One thing to note is that currently, even with this, the MacVim binary
still has a weak linking dependency to the non-existent
Sparkle.framework (can be seen by doing `otool -L
MacVim.app/Contents/MacOS/MacVim`) but it should be fine. A proper way
to fix this is to manually link Sparkle instead of letting Xcode do it
for us, but considering that this is a relatively niche use case, and it
still works regardless, there isn't a pressing need to do so.
Also, add CI check to make sure when `--disable-sparkle` is used, the
actual MacVim binary has 0 references to Sparkle symbols. This makes
sure that removing the Sparkle.framework from the app bundle is actually
safe.
Problem: Too many "else if" statements in handling options.
Solution: Add more functions for handling option changes. (Yegappan
Lakshmanan, closes#12060)
This fixes build breaks on older Xcode versions (e.g. Xcode 8, on macOS
10.11). Fixes a couple issues:
- Vim's os_mac.h has an improperly specified backwards compatibility
ifdef (https://github.com/vim/vim/pull/10549). It's just checking for
existence of `MAC_OS_X_VERSION_10_12` instead of actually comparing it
against `MAC_OS_X_VERSION_MAX_ALLOWED`. The previous code that it was
fixing was comparing it against `MAC_OS_X_VERSION_MIN_REQUIRED` which
was also wrong as the "min" just means the deploy target, whereas the
"max" indicates the SDK you are compiling against.
- Unfortunately, the `@available` syntax for checking runtime version
was only introduced in Xcode 9. To make the code compilable in earlier
Xcode versions, introduce a new macro `AVAILABLE_MAC_OS` which will
use `@available` if compiling on Xcode 9+ (which is the vast majority
of cases), and use NSAppKitVersion checks on Xcode 8 or below. We
would like to still use `@available` checks if possible because the
compiler can optimize that out if it detects that you are deploying to
a higher target than what you are checking.
- Some typedefs in MacVim are also introduced in 10.13+. Add those
typedefs to MacVim.h
Fix#1342
Problem: Too many "else if" statements to handle option values.
Solution: Add more functions to handle option value changes. (Yegappan
Lakshmanan, closes#12058)
Currently when quitting MacVim, MMVimController will throw an exception
in `sendMessage:`. This is because MMAppController's handler for
quitting simply closes the connection, terminates the Vim processes and
quit; it doesn't individually shut down each Vim controller cleanly.
This is actually ok because we are quitting the app anyway, and it's not
terrible to just let the OS clean up (applicationWillTerminate also has
a 5 second executation timer set by macOS), but we do need to make sure
Vim controllers won't be trying to handle the now invalid connections.
Currently the exceptions will be caught by an exception handler, but
it's still not great, and could be confused with a bug, especially if
logging is enabled.
Add a way to set `isInitialized` to NO when shutting down, so that the
controllers will be blocked from trying to send connections.
Problem: No test for bad use of spaces in help files.
Solution: Add checks for use of spaces in help files. Ignore intentional
spaces. (Hirohito Higashi, closes#11952)
Problem: Crash when using buffer-local user command in cmdline window.
(Karl Yngve Lervåg)
Solution: Use the right buffer to find the user command. (closes#12030,
closes#12029)
Problem: Cursor in wrong position below line with virtual text below ending
in multi-byte character.
Solution: When checking for last character take care of multi-byte
character.
Problem: "gj" and "gk" do not move correctly over a closed fold.
Solution: Use the same code as used for "j"/"k" to go to the next/previous
line. (Luuk van Baal, closes#12007)
Problem: Crash when indexing "any" which is an object.
Solution: Check the index is a number. Do not check the member type of an
object. (closes#12019)
Problem: Checking the type of a null object causes a crash.
Solution: Don't try to get the class of a null object. (closes#12005)
Handle error from calling a user function better.
Problem: MS-Windows: vimfiles dir created with admin group.
Solution: Use ShellExecAsUser to create the vimfiles directory. (Christopher
Plewright, Ken Takata, closes#12000, closes#11888)
Problem: :messages behavior depends on 'fileformat' of current buffer.
Solution: Pass the buffer pointer to where it is used. (Mirko Ceroni,
closes#11995)
We are already removing the XPCServices folder in Sparkle 2 because it's
unnecessary for us, but there's a top-level symlink that still refers
to the folder, and its existence could potentially break automated
scripts and whatnot. Just clean it up and remove it as well in the
cleanup script.
Fix#1366
Problem: "$" for 'list' option displayed in wrong position when there are
text properties.
Solution: Adjust logic for order of displayed items. (closes#11959)
Problem: 'statusline' only supports one "%=" item.
Solution: Add support for multiple "%=" items. (TJ DeVries, Yegappan
Lakshmanan, closes#11970, closes#11965)
Problem: Inserting a register on the command line does not trigger
incsearch or update hlsearch.
Solution: Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate
and handle it correctly. (Ken Takata, closes#11960)
Problem: Calling an object method with arguments does not work. (Ernie
Rael)
Solution: Take the argument count into account when looking up the object.
(closes#11911)
Problem: :defer may call the wrong method for an object. (Ernie Rael)
Solution: When en object is from a class that extends or implements, figure
out the method to call at runtime. (closes#11910)
Updated to Vim 9.0.1276
Features
====================
Dictionary lookup
--------------------
You can now use Force Touch or Cmd-Ctrl-D to look up definitions of word
under the cursor (or selected text in visual mode). This will also
preview URLs, and support data types such as phone numbers and
addresses. #1312#1313
This feature can also be invoked programmatically from VimScript (see
`:h macvim-lookup`). #1315
Tool bar / Touch Bar / menu icons
--------------------
You can now use SF Symbols for Tool bar and Touch Bar icons, including
using different symbol styles such as "palette" or "multicolor". Menu
items can now also use the `icon=` syntax to specify icons as well. See
`:help macvim-toolbar-icon` for details. #1329
The default tool bar also has updated icons to look similar to SF
Symbols used by newer macOS versions. #1214 by @sfsam
Window management actions
--------------------
There are new `macaction`'s for managing the MacVim window. The new
`zoomLeft`/`zoomRight` actions allow you to pin the window to the
left/right of the screen, and there are also new actions for interacting
with Stage Manager (requires macOS 13+). See `:h macvim-actions` for
details. #1330
Pre-release updates / Sparkle 2
--------------------
MacVim now supports pre-release software builds. It's sometimes hard for
us to release frequent updates due to the desire to pick a stable
upstream Vim version, needing to test the release on multiple OS
versions, making sure there aren't half-complete or buggy features, and
other reasons.
This new feature now allows us to push pre-release beta builds out in a
more frequent fashion, which could be useful if there are particular
features or fixes that you would like to try out before the next
official release. Pre-release builds will be released depending on bug
fixes and features instead of a fixed cadence. Do note that these
pre-release builds may not be as well-validated and may have half-baked
features.
If you are using the built-in auto-updater to update MacVim, you can
turn this on by going to Advanced settings pane, and enable "Enable
pre-release software updates".
This feature is only available for macOS 10.13 or above.
The auto-updater has also been updated from Sparkle 1.27.1 to 2.3.0 for
10.13+ builds. Legacy (10.9-10.12) builds are still using Sparkle 1.
See #1332.
New Vim features
--------------------
New `smoothscroll` option allows you to scroll through a long wrapped
line (using Ctrl-E or mouse wheel) without immediately jumping to the
next line. (v9.0.0640)
`splitscroll` option has been renamed `splitkeep`, with more flexibility
than before. (v9.0.0647)
Sound playback on macOS is now supported. You can use `has('sound')` to
check. See `help sound` for details. (v9.0.0694)
Terminals now support `:confirm` for `:q`, etc, which also means
MacVim's Cmd-W will work properly for terminal windows. (v9.0.0710)
Virtual text had numerous bugs fixed.
General
====================
Legacy build for 10.9 - 10.12
--------------------
Per a previous announcement (#1271), the default MacVim binary will now
require macOS 10.13 or above. Users of macOS 10.9 - 10.12 can use a
separate "legacy" build which will still be supported. The legacy binary
will still have the latest versions of Vim and be supported, but may not
have all the latest features (e.g. pre-release builds).
If you are using the auto-updater (Sparkle) to update MacVim, it should
"just work" and find the best version for you. If you are downloading
MacVim from the website, there is also a link to download the legacy
version marked for 10.9+ as well. If you download the normal binary
marked for 10.13+ from the website, it won't work on these older macOS
versions.
See #1331.
Fixes
====================
CoreText Renderer clipping and rendering bugs
--------------------
Unicode characters with multiple composing characters (e.g. "x⃗") will
now render correctly. #1172
Texts (e.g. Tibetan, Zalgo texts) that are taller than the line height
will no longer be clipped inappropriately. You can use a new setting
`MMRendererClipToRow` to re-enable clipping if the tall texts are
distracting. #995 / #1356
Tab crash
--------------------
Fixed a crash when opening new tabs that seems to only occur in macOS 13
Ventura. #1333
Other bugs
--------------------
- Fixed non-native full screen not working well with the notch on newer
MacBook's when set to not show menu bar. You can also use
`MMNonNativeFullScreenSafeAreaBehavior` to force MacVim to use the
notch area as well if you don't mind some content being obscured. Note
that the previous release also claimed it fixed this, but because the
binary was built against an old macOS SDK (Big Sur), the fix did not
work in the binary release. #1261
- Allow "Open untitled window: never" and "After last window closes:
Quit MacVim" to be set together again. Added safeguards to make sure
doing so won't immediately close the app. #1338
- Edit.Cut / Copy menu items will now be properly disabled when there
isn't selected text. #1308
- Fixed potential `:emenu` crash when the menu is associated with an
action in a non-valid mode. #1305
- Fixed bug where just bringing up the right-click (or the
MacVim→Services) menu would somehow copy the selected texts to the
system clipboard. #1300
- Fixed a Japanese input method bug where using left/right arrow to move
to a different section of the input text would previously result in
the candidate list not showing up at the correct position. #1312
- Fix non-CoreText renderer not handling text styles like strikethrough
correctly (note: this renderer has been deprecated for a while and you
should not use it). #1296
- This release uses an older sh/bash syntax file because the latest one
in Vim has a bug. #1358
Misc
====================
New settings:
- "No drop shadows" (Appearance). #1301
- "Treat Ctrl-click as right-click" (Input) (#1326). This was previously
configurable via command-line, but now also possible in the settings
pane under the new "Input" category.
"About MacVim" now reports the version number in a clearer way with
clearly specified release number vs Vim version.
Known Issues
====================
Printing
--------------------
Printing using File→Print or `:hardcopy` is currently not working under
macOS 13 Ventura due to its removal of PostScript support in the Preview
app. This will be fixed in a later release. See the issue for
workarounds. #1347
Scripting
====================
- Scripting languages versions:
- Perl is now built against 5.30, up from 5.18.
- Ruby is now built against 3.2, up from 3.1.
Compatibility
====================
Requires macOS 10.9 or above. (10.9 - 10.12 requires downloading a
separate legacy build)
Script interfaces have compatibility with these versions:
- Lua 5.4
- Perl 5.30
- Python2 2.7
- Python3 3.10
- Ruby 3.2
Similar to #1334. The old PSMTabBarControl code has a lot of dubious
straggling states regarding the tracking tags. Seems like previous macOS
versions tolerated that but in the newer macOS versions, the tags seem
to be reused for other purposes and so when you double-remove the tags,
you get into trouble.
Related to #1333
Currently, it's hard to embed video in the release notes shown to
Sparkle, because by default it disables JavaScript, which video tags
need in order to work properly for the WebKit embedded browser. Turn it
on, so that we can show video instead of animated GIF's in the future
for release notes.
I don't think there should be any serious security issues after thinking
about it. The browser is sandboxed and we are serving this through https
anyway.
We previously removed the --deep flag from signing, which missed one of
the executable within Sparkle 1 that we need to sign expicitly (Sparkle
1 is still used for legacy builds).
The latest Vim runtime update upgraded sh.vim from version 204 to 205,
which contains a bug (https://github.com/vim/vim/issues/11937). Since we
are releasing MacVim soon, simply revert this change to have a stable
build and we will revert this when Vim has fixed this upstream.
Use a better format for the version reporting in the "About MacVim" page
to be clear what's the Vim version, and what's specifically the MacVim
release number.
Also, store the last used MacVim version number. This isn't used right
now but may be used later for showing up a "What's New" page when
updating to a new version, primarily for non-Sparkle users (e.g.
Homebrew builds) so they can still be notified when something changed.
Storing this number now allows us to know in a later build whether the
user has upgraded to the build or starting a new build from fresh (where
we may not want to show the "What's New" page as everything would be
new).
Part of addressing #1293
Problem: .clangd and .stylelintrc files don't get a filetype.
Solution: Use yaml for .clangd and json for .stylelintrc files. (Mark
Skelton, closes#11916)
Problem: The did_set_string_option function is too long.
Solution: Further cleanup of handling string options. (Yegappan Lakshmanan,
Lewis Russell, closes#11920)
Problem: The did_set_string_option function is too long.
Solution: Split off functionality to individual functions. (Yegappan
Lakshmanan, Lewis Russell, closes#11904)
This fixes the issue where particularly tall characters will get clipped
at the row boundary. This happens because even though a font describes
the line height with font metrics, individual glyphs do not have to
respect them, and we can see with emoji rendering sometimes they can
poke upwards past the line height. Also, it's trivially easy to
construct composing characters that become really tall, e.g. "x゙̂⃗", or
Tibetan scripts like "ཧཱུྃ".
To fix this, we do the following:
1. Remove the explicit clipping call at rendering.
2. Fix partial redraw to not lead to clipping / corruption. This is
quite tricky, because let's say we have a character that is tall
enough to touch other lines, if those lines are redraw but not the
line with the tall char, the redraw will paint over the parts of the
glyphs poking through. Alternatively if we redraw the line with the
tall chars we also need to expand the redraw region to make sure
other lines get repainted as well. To fix this properly, we should do
a proper glyph calculation when we receive the draw command before we
issue before we call `setNeedsDisplayInRect`, but since right now we
only extract glyph info later (during drawRect call), it's too late.
We just do the hacky solution by storing a variable
`redrawExpandRows` that tracks how many lines to expand for all
lines. It's a little hacky since this will affect all lines
permanently regardless if they have tall characters or not. The
proper fix may come later as an optimization (or when we do hardware
rendering via Metal).
3. Re-order the rendering so we have a two pass system, where we first
draw the background fill color for all rows, then the text. This
helps prevent things like Vim's window split or cursorline from
obscuring the text.
4. Add a preference to turn on clipping (old behavior). This helps
prevent odd issues with really tall texts (e.g. Zalgo text) making it
hard to see what's going on. The preference `MMRendererClipToRow` is
not exposed in UI for now as it's a relatively niche. It will be
exposed later when we have a dedicated render tab in settings.
Note that a lot of these characters only show their full height by doing
`set maxcombine=8` because the default (2) is quite low.
Part of the fix for #995
MacVim previously didn't really render composing characters with
multiple glyphs correctly. For simple ones like 'â' it would work fine
because Core Text just generates one glyph for it, but for more
complicated ones like 'x⃗' the renderer didn't properly query the advance
of the glyphs to put them at the correct position. Refactor the logic to
keep track of the current cell/glyphs and make sure to track the
advances fo the glyphs so the composing chars' glyphs would be laid out
properly on top of the cell.
We need to be careful with the tracking, because in Vim we force the
text rendering to be monospaced, and so we maintain the tracking within
a single grapheme (which can consist of multiple glyphs), but when we
move to the next grapheme we reset the position so we can get proper
monospaced rendering even for non-monospaced texts like CJK or stylized
texts.
Fix#995Fix#1172
I have looked and I do not believe there is a good reason to do this
rounding up at all. I believe the motivation is to align the baseline
with the pixel boundary, but I don't believe that is necessary, given
that Core Text will properly perform the correct antialiasing for us.
Most texts aren't directly aligned at the baseline anyway. Before, that
ceil() option is a reason why sometimes fonts would feel pushed upwards,
clipping emojis to the top, and creating a lopsided effect for fonts
like Fira Code (h11), since we draw the boxes aligned to the line
height at the bottom of the descender, meaning the ceil() has an effect
of pushing the text up.
The setting was added to "preserve" the font's original line spacing
intents, but after further investigation I cannot find why Apple's
calculation for font line spacing to be so wide. Furthermore it's quite
odd because the default line spacing is wide, but the only thing that
setting does is by re-initializing the font under Core Text (instead of
using NSFont like the default) using CTFont and somehow the issue is
fixed. Inspecting font metrics (using ttx) also didn't seem to give any
hints why the spacing are so wide (e.g. ascent / descent / line gap etc
all look fine). A StackOverflow comment seems to suggest that Apple is
simply adding a 1.2x scale to some fonts
(https://stackoverflow.com/questions/5511830/how-does-line-spacing-work-in-core-text-and-why-is-it-different-from-nslayoutm)
which seems to match the observation. My guess is that Apple looks at
some fonts and think they are too aggressive in their font metrics
design and "helpfully" introduces a 1.2x multiplier to space them out,
where Core Text is lower level than AppKit and therefore does not have
this auto-inflation.
By renaming the option it should make it clearer that this is a somewhat
arbitrary distinction instead of it being an inherent property of the
font.
Problem: MS-Windows: scrollback cropped off on Vim exit.
Solution: Don't call SetConsoleScreenBufferInfoEx when using the alternate
screen buffer. (Christopher Plewright, closes#11882)
Problem: Cursor briefly displayed in a wrong position when pressing Esc in
Insert mode after autoindent was used.
Solution: Do not adjust the cursor position for assumed deleted white space
if text is following. (closes#11877)
Problem: Cannot access a private object member in a lambda defined inside
the class.
Solution: Go up the context stack to find the class. (closes#11866)
Problem: :runtime completion can be further improved.
Solution: Also complete the {where} argument values and adjust the
completion for that. (closes#11874)
Problem: Spurious empty line when using text propertie and virtual text.
Solution: Do not set "text_prop_follows" when the other text property is not
virtual text. (closes#11846)
Problem: Termcap/terminfo entries do not indicate where modifiers might
appear.
Solution: Add ";*" for function keys where modifiers are likely to be used.
Problem: Using isalpha() adds dependency on current locale.
Solution: Do not use isalpha() for recognizing a URL or the end of an Ex
command. (closes#11835)
Problem: Adding a line below the last one does not expand fold.
Solution: Do not skip mark_adjust() when adding lines below the last one.
(Brandon Simmons, closes#11832, closes#10698)
Problem: Testing with Python on AppVeyor does not work properly.
Solution: Fix typo. Move most lines to the .bat file. (Christopher
Plewright, closes#11828)
Problem: Crash when handling class that extends another class with more
than one object members.
Solution: Correct pointer computations. (closes#11824)
Problem: Screen is not redrawn after using setcellwidths().
Solution: Redraw the screen when the cell widths have changed. (Yasuhiro
Matsumoto, closes#11800)
Problem: Some key+modifier tests fail on some AppVeyor images.
Solution: Adjust the tests for key movements and fix the revealed bugs.
(Christopher Plewright, closes#11798)
Problem: Evaluating string expression advances function line.
Solution: Disable function lines while parsing a string expression.
(Hirohito Higashi, closes#11796)
Problem: Configure does not handle all FORTIFY_SOURCE variants.
Solution: Also handle Fedora's default FORTIFY_SOURCE flags. (Zdenek Dohnal,
closes#11794)
Problem: Class "implements" argument not implemented.
Solution: Implement "implements" argument. Add basic checks for when a
class implements an interface.
Problem: MS-Windows: various special keys and modifiers are not mappable.
Solution: Adjust the handling of keys with modifiers. (Christian Plewright,
closes#11768)
Problem: Crash and/or memory leak when redefining function after error.
Solution: Clear pointer after making a copy. Clear arrays on failure.
(closes#11774)
Problem: 'cursorcolumn' and 'colorcolumn' wrong after concealing and
wrapping line.
Solution: Reset "wlv.vcol_off" after each screen line. (Alexey Radkov,
closes#11777)
When adding support for gettext in #1070, a MacVim-specific ifdef was
added unnecessary around `bindtextdomain`. That ifdef isn't actually
necessary and it seems to have been done due to an incorrect
understanding of the ifdef logic there regarding `FEAT_GETTEXT`. Just
remove it to clean it up. Localization should still work.
Problem: Unexpected output when autoloading a script for an interactive
operation.
Solution: Reset "KeyTyped" while loading a script and when handling a nested
function. (closes#11773)
Problem: Virtual text at a column position is truncated at the window edge.
(Yegappan Lakshmanan)
Solution: Do not truncated virtual text that is placed at a column.
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes#11764)
Problem: Terminfo entries for bracketed paste are not used.
Solution: Use the newly added terminfo entries for bracketed paste.
Correct mixup of output strings and key codes.
Problem: A hashtab with many removed items is not cleaned up.
Solution: Re-hash a hashtab even when the size didn't change if too many
items were removed.
Problem: Search error message doesn't show used pattern.
Solution: Pass the actually used pattern to where the error message is
given. (Rob Pilling, closes#11742)
Problem: Assignment to non-existing member causes a crash. (Yegappan
Lakshmanan)
Solution: Give an error message and bail out when a member cannot be found.
Problem: Display wrong in Windows terminal after exiting Vim.
Solution: Apply screen restore fix for Windows 11 also to Windows 10 builds.
(Christopher Plewright, closes#11713, closes#11706)
Problem: Code handling low level MS-Windows events cannot be tested.
Solution: Add test_mswin_event() and tests using it. (Christopher Plewright,
closes#11622)
Problem: The "kitty" terminfo entry is not widespread, resulting in the
kitty terminal not working properly.
Solution: Go back to using "xterm-kitty" and avoid the problems it causes in
another way.
Problem: Can add text property with negative ID before virtual text
property.
Solution: Remember that a text property with a negative ID was used and give
an appropriate error message. (closes#11725)
Fix index computation.
Problem: Using "xterm-kitty" for 'term' causes problems.
Solution: Remove the "xterm-" part when 'term' is set from $TERM. Detect a
few kitty-specific properties based on the version response
instead of the terminal name.
Problem: No information about whether requesting term codes has an effect.
Solution: Add ch_log() calls to report the effect of term code responses.
Avoid deleting an entry and then adding back the same one.
Problem: A shell command switching screens may still have a problem with
the kitty keyboard protocol.
Solution: Disable the kitty keyboard protocol both in the current and the
alternate screen, if there are indications it might be needed.
(issue #11705) Also fix naming.
Problem: Code for making 'shortmess' temporarily empty is repeated.
Solution: Add functions for making 'shortmess' empty and restoring it.
(Christian Brabandt, closes#11709)
Problem: When using Kitty a shell command may mess up the key protocol
state.
Solution: Output t_te before t_TE. If t_te switches between the main and
the alternate screen then deactivating the key protocol by t_TE
should happen after switching screen. (issue #11705)
Problem: Some test function names do not match what they are doing.
Solution: Leave out user data for the test that is called "NoUserData".
(closes#11703)
Problem: Build failure with some compilers that can't handle a
declaration directly after a "case" statement.
Solution: Add a block to put the declarations in.
Problem: Conflict between supercollider and scala filetype detection.
Solution: Do not check for "Class : Method", it can appear in both
filetypes. (Chris Kipp, closes#11699)
Problem: Object member can't get type from initializer.
Solution: If there is no type specified try to use the type of the
initializer. Check for a valid type.
Problem: With "screenline" in 'culopt' cursorline highlight is wrong.
Solution: Apply the priority logic also when "screenline is in 'culopt'.
(closes#11696)
Problem: Using a <Cmd> mapping CmdlineChanged may be triggered twice.
Solution: Count the number of times CmdlineChanged is triggered and avoid
doing it twice. (closes#116820
Problem: lalloc(0) error for a class without members.
Solution: Don't allocate room for members if there aren't any.
Don't create the class if there was an error.
Problem: Mouse shape test is flaky, especially on Mac OS.
Solution: Instead of starting all timers at the same time, start the next
one in the callback of the previous one. (Yee Cheng Chin,
closes#11673) Also use "bwipe!" instead of "close!" to avoid
swap files remaining.
Problem: 'smoothscroll' and virtual text above don't work together.
(Yee Cheng Chin)
Solution: Skip virtual text above when w_skipcol is non-zero.
(closes#11665)
Problem: There is no way to get a list of swap file names.
Solution: Add the swapfilelist() function. Use it in the test script to
clean up. Remove deleting individual swap files.
Problem: Classes are not documented or implemented yet.
Solution: Make the first steps at documenting Vim9 objects, classes and
interfaces. Make initial choices for the syntax. Add a skeleton
implementation. Add "public" and "this" in the command table.
Problem: If 'keyprotocol' is empty "xterm" still uses modifyOtherKeys.
Solution: Remove t_TI, t_RK and t_TE from the "xterm" builtin termcap and
let the default value of 'keyprotocol' add those.
Problem: Display errors when adding or removing text property type.
Solution: Perform a full redraw. Only use text properties for which the
type is defined. (closes#11655)
Problem: Crash when reading help index with various options set. (Marius
Gedminas)
Solution: Do not set wlv.c_extra to NUL when wlv.p_extra is NULL.
(closes#11651)
Problem: Callback name argument is changed by setqflist().
Solution: Use the expanded function name for the callback, do not store it
in the argument. (closes#11653)
Problem: When using kitty keyboard protocol function keys may not work.
(Kovid Goyal)
Solution: Recognize CSI ending in [ABCDEFHPQRS] also when the termcap
entries are not specified. (closes#11648)
Problem: The keyboard state response may end up in a shell command.
Solution: Only request the keyboard protocol state when the typeahead is
empty, no more commands are following and not exiting. Add the
t_RK termcap entry for this.
Problem: It is not easy to see what client-server commands are doing.
Solution: Add channel log messages if ch_log() is available. Move the
channel logging and make it available with the +eval feature.
Problem: Kitty keyboard protocol key not decoded when it has an unsupported
modifier, such as NumLock.
Solution: Accept a key with any modifier. (closes#11638)
Problem: Matchparen highlight is not updated when switching buffers.
Solution: Listen to the BufLeave and the BufWinEnter autocmd events.
(closes#11626)
Problem: Status line of other window not redrawn when dragging it when
'splitkeep' is set to "screen".
Solution: Set w_redr_status earlier. (Luuk van Baal, closes#11635,
closes#11632)
Problem: Error when using the "Tools / Spelling / Find More Languages"
menu.
Solution: Remove "<SID>". Reset "g:menutrans_set_lang_to" when 'encoding'
changes. (closes#11625)
Problem: Cannot detect whether modifyOtherKeys is enabled.
Solution: Use XTQMODKEYS introduced by xterm version 377 to request the
modifyOtherKeys level. Update the keycode check results.
Problem: Pretending to go out of Insert mode when Esc is received has side
effects.
Solution: When the kitty keyboard protocol is enabled expect Esc to always
be the start of an escape sequence.
Problem: Crash when typing a letter in a terminal window. (Shane-XB-Qian)
Solution: Use the "vterm" variable instead of getting the terminal pointer
from the current buffer. (closes#11608)
Problem: Still using simplified mappings when using the kitty keyboard
protocol.
Solution: Use the kitty_protocol_state value to decide whether to use
simplified mappings. Improve how seenModifyOtherKeys is set and
reset.
Problem: MS-Windows: mouse column limited to 223.
Solution: Use two bytes for each mouse coordinate. Add the mouse position
to scroll events. (Christopher Plewright, closes#11597)
Problem: Cannot debug the Kitty keyboard protocol with TermDebug.
Solution: Add Kitty keyboard protocol support to the libvterm fork.
Recognize the escape sequences that the protocol generates. Add
the 'keyprotocol' option to allow the user to specify for which
terminal what protocol is to be used, instead of hard-coding this.
Add recognizing the kitty keyboard protocol status.
Problem: Two conditions are always false.
Solution: Remove the conditions. Update return value types to make clear
what could be returned. (closes#11593)
Problem: Second SIGWINCH signal may be ignored.
Solution: When set_shellsize() is busy when called then run the inner code
again when it's done. (issue #424)
Problem: MS-Windows: modifier keys do not work with mouse scroll events.
Solution: Use K_SPECIAL instead of CSI for the modifier keys. (Christopher
Plewright, closes#11587)
Problem: Only a change in the current window triggers the WinScrolled
event.
Solution: Trigger WinScrolled if any window scrolled or changed size.
(issue #11576)
Problem: libvterm with modifyOtherKeys level 2 does not match xterm.
Solution: Adjust key code escape sequences to be the same as what xterm
sends in modifyOtherKeys level 2 mode. Check the value of
no_reduce_keys before using it.
Problem: With 'smoothscroll' cursor is one screen line too far down. (Ernie
Rael)
Solution: Add a test that currently has the wrong result so that a fix can
be made. (issue #11436)
Problem: Test for home key fails when 'term' is "tmux".
Solution: Only save termcap entries that exist. Adjust code for xHome to
what xterm uses. (closes#11566)
Problem: Virtual text property highlight ignores window background.
Solution: Combine text prop attribute with win_attr into extra_attr.
(closes#11462)
Problem: May redraw when not needed, causing slow scrolling.
Solution: Do not redraw when w_skipcol doesn't change. When w_skipcol
changes only redraw from the top. (issue #11559)
Problem: Keycode check script has a few flaws.
Solution: Sort on terminal name. Ignore XTGETTCAP responses. Check for
version and status response. Update entries.
Problem: MS-Windows GUI: CTRL-] does not work on Swiss keyboard.
Solution: Check the key code and don't consider it as a dead key. (Aedin
Louis Xavier, closes#11556)
Problem: Cannot easily try out what codes various keys produce.
Solution: Add a script to gather key code information, with an initial list
of codes to compare with.
Problem: Horizontal mouse scroll only works in the GUI.
Solution: Make horizontal mouse scroll also work in a terminal.
(Christopher Plewright, closes#11448)
Problem: A silent mapping may cause dots on the command line.
Solution: Don't show dots for completion if they are not going to be removed
again. (closes#11501)
Problem: Get E967 when using text property in quickfix window. (Sergey
Vlasov)
Solution: Do not add an extra NUL and compute the text length correctly.
(closes#11513)
Problem: MS-Windows: after Vim exits console resizing does not work
properly.
Solution: Restore screen behavior checks for various WT and VTP
combinations. (Christopher Plewright, closes#11526,
closes#11507)
Problem: Duplicate arguments are not always detected.
Solution: Expand to full path before comparing arguments. (Nir Lichtman,
closes#11505, closes#9402)
Problem: col() and charcol() only work for the current window.
Solution: Add an optional winid argument. (Yegappan Lakshmanan,
closes#11466, closes#11461)
Problem: Solution for "!!sort" in closed fold is not optimal.
Solution: Use a different range instead of the subtle difference in handling
a range with an offset. (issue #11487)
Problem: MS-Windows Terminal has unstable color control.
Solution: Do not try to read the old command prompt colortable, use modern
VT sequences. (Christopher Plewright, closes#11450,
closes#11373)
Problem: Shell command with just space gives strange error.
Solution: Skip white space at start of the argument. (Christian Brabandt,
Shane-XB-Qian, closes#11515, closes#11495)
Problem: Handling 'statusline' errors is spread out.
Solution: Pass the option name to the lower levels so the option can be
reset there when an error is encountered. (Luuk van Baal,
closes#11467)
Add CI test to confirm desired Vim features like +sound / etc exist.
Smoketest also checks for libsodium now by trying to set xchacha20
cryptmethod which can only succeed if sodium is enabled. Also make sure
it's actually checking the scripting language bindings are working
properly. Previously for some reason it wasn't checking the print
results.
Problem: The window title is not redrawn when 'endoffile' changes.
Solution: redraw the window title when 'endoffile' is changed. (Ken Takata,
closes#11488)
Previously we disabled this combo in f6ba7dd40b because when
implemented naively, it causes an issue where just opening an About
MacVim or Settings window could immediately cause MacVim to exit
(because macOS determined that there were no non-auxillary window open).
This was awkward and potentially made it hard to change the setting
back, and exact behavior depended on OS behavior.
However, it seems like there are legit use case for this combo of
settings. Change it so that we allow setting both of them again, but add
checks so that `applicationShouldTerminateAfterLastWindowClosed:` will
only return `YES` if we have opened at least one Vim window before. This
gives the user a chance to open a window first, so using Settings etc
wouldn't immediately terminate the app.
Fix#1338
Sparkle 2:
Seems like older Xcode versions (before 12.5) have problems signing
frameworks that only have a Versions/B but not a Versions/A folder.
Sparkle 2 moved to only having Versions/B which is causing code sign to
fail on build step. Just fix this issue by disabling Sign on Copy for
Sparkle.framework. We don't really need it because it already comes with
an ad-hoc signature anyway, and for publish we have a custom signing
script (sign-developer-id) to do manual signing.
Also, fix CI to use Sparkle 2 again for old Xcode (11.7) builds to test
this working. Previously we made it use Sparkle 1 because we didn't work
around this issue, which was kind of a hack.
For Sparkle 2, also add a `cleanup-after-build` script to remove the XPC
Services folder in the framework. Sparkle dev added this to the bundle
for sandboxed apps but non-sandbox apps don't really need it and it's
recommended by Sparkle to remove them, so we unfortunately need to
manually do it as a post-build step.
Fix#1335
Signing / notarization scripts:
Make sure to sign Sparkle 2 binaries in `sign-developer-id`. Also, seems
like the "--deep" flag in codesign is now deprecated as of macOS 13, so
just stop using it and manually sign all the relevant binaries
explicitly.
For notarization script, the current behavior doesn't correctly detect
failure as `xcrun notarytool submit` always exits with 0 even if the
submission failed. Add logic to manually query whether the submission
succeeded. If failed, print out the logs for easier diagnosis, and
exits with -1 so it will block progress.
This seems to be a really old bug but new interactions with macOS
(probably due to macOS 13 Ventura) caused it to surface and crash.
Previously it was assuming a call to removeTrackingRect must always come
only after addTrackingRect was called, which was not a good assumption
to make. As a result, we could call this and end up triggering other
code in macOS when passing in a 0 tracking tag.
Fix#1333
Add a new option for the user to opt-in for getting pre-release
software. When turned on, Sparkle will accept a new "prerelease" channel
for updates.
This feature only works in Sparkle 2, which means legacy binaries
(10.9-10.12) which use Sparkle 1 won't get this. It's possible to
implement this for Sparkle 1 but we would need to do so in a completely
different (and more annoying) manner of using two separate appcast XML
files and switch among them. Given the niche nature of legacy binaries,
this is not worth doing.
The setting is in the Advanced settings pane because the pre-release
builds aren't guaranteed to be stable or well-tested, so we don't want
users to turn it on unless they looked for it. For terminology, went
back and forth on "beta", "preview", "pre-release", and eventually
settled on "pre-release" builds which also lines up with GitHub
Release's convention.
Use the updated API (SPUStandardUpdaterController instead of SUUpdater).
Old functionality now use a USE_SPARKLE_1 compiler define to switch to
old behavior when building for legacy builds.
Add a delegate class that we can use to customize Sparkle behavior.
Also, make sure DISABLE_SPARKLE will prevent including headers as well
- Previously it was a mistake to keep including the headers. Now it should
be completely de-coupled.
Add a configure flag to set the USE_SPARKLE_1 ifdef flag. In CI legacy
builds, we will relink the symlink to point to Sparkle_1.framework and
also call that configure flag so the code will build.
This adds Sparkle 2 to the project add changes the symlink to point to
it. This version has changed the min OS requirement from 10.9 to 10.13,
and as such we keep the old Sparkle 1 around, and during CI, we swap to
it when building legacy binary (regular MacVim has minOS set to 10.13,
while legacy has min OS set to 10.9).
SDK for the new macOS 13 (released as part of Xcode 14.1) increased the
minimum deployed OS from 10.9 to 10.13. Since we still want to support
a minimum OS requirement of 10.9, while building against the latest SDK
to get the most up-to-date features, we have to split the build process
to build two separate binaries. A regular MacVim that targets the macOS
13 SDK (with min OS target 10.13), and a "legacy" MacVim that targets
the macOS 12 SDK (with min OS target 10.9).
Change the GitHub Action CI config to have two separate matrix entries
that publish, with one having a "legacy" flag set, which will use the
older version of Xcode and the correct env vars set. It will also only
build for x86-64 (no arm64) since currently all Apple Silicon hardware
can run the latest versions of macOS and would have no need to run
legacy builds.
Also, fix some scripting issues:
- fix Python 2 library path set incorrectly
- Update Perl to 5.30 from 5.18, as 5.18 is no longer installed in macOS
13. We could potentially change Perl to use the Homebrew version
instead similar to how Python and other scripting languages are done
but for now this works fine (except it won't work on older macOS
versions). Perl is a rarely used language for Vim plugins.
See https://github.com/macvim-dev/macvim/discussions/1288
Problem: The <Home> key in tmux doesn't work when 'term' is set to "xterm".
(Dominique Pellé)
Solution: Only use '@' in a termcap key entry for "1" when ";" follows.
(closes#11429)
Problem: If 'endofline' is set the CTRL-Z may be written in the wrong
place.
Solution: Write CTRL-Z at the end of the file. Update the help to explain
the possibilities better. (Ken Takata, closes#11486)
Problem: Mouse drag test fails.
Solution: Only reset the mouse click flag when actually switching to another
tab page. Disable test that keeps failing.
New zoomLeft/Right actions let the user easily pin the MacVim window to
the left/right of the screen using the private APIs _zoomLeft: /
_zoomRight:. This is similar to Windows' Aero Snap mode, and the
functionality has been in macOS since 10.15. Unfortunately there isn't a
public API for calling this.
Note that this could already be done if the user went to the Keyboard
settings and added a shortcut key to the Window -> "Move Window to Right
Side of Screen" menu, but I doubt a lot of people do that, and it's
nicer to have script-level control of this. The other likely option
users would have adopted is to use a third-party tool. This change
mostly makes it possible to easily snap the windows without needing to
use them.
Also, add new macOS 13 Ventura hooks for interfacing with Stage Manager.
Expose the `_removeWindowFromStageManagerSet:`, which is the private API
behind the new "Remove Window from Set" menu item, which removes the
window from a mixed application set in Stage Manager. Similar to
_zoomLeft:, this is a UI-only feature, and hence no public API is
avaialble. Also, expose the collections API so that we can call
join/unjoinAllStageManagerSets: to have MacVim windows float among all
Stage Manager sets, which is useful for windows that need to show up
next to other windows (e.g. a copy-and-paste scratchpad file).
Also add a new separator to the Window menu because macOS injects all
the window/Stage Manager related menu items right after the "Zoom" item,
and it kind of expects a separator to be right after it for the new
items to be categorized right.
Can now specify SF Symbols for tool bar / Touch Bar icons. The API
remains the same where we use the "icon=" syntax in Vim menus to specify
the icon, and just passing in the symbol name (e.g. 'gear.circle'). Also
extended this to system named images like 'NSAdvanced' (the old gear
shaped image), as previously we only had a specical case for Touch Bar
system named template images. When loading the icon, MacVim will
automatically determine whether it's an SF Symbol, system named image,
or a file.
SF Symbols can also be customized to be of a particular symbol style, or
have a variable number set, by using colon-delimted option strings. For
example: `aqi.high:palette:variable-0.5` is a symbol that uses the
palette style, set to 0.5 variable value.
Menu items now also support icons, the same as tool bars. We still don't
support specifying icons for a submenu (which has been an issue for
Touch Bar) since the Vim menu API doesn't support a way to do so.
Also add an ability to use a `:template` value to specify that an image
file is a template image. This is important to fix a minor regression
introduced in #1214 where every image loaded in were assumed to be
template.
Add documentation to make this clear. See `:help macvim-toolbar-icon`.
Also see comment in #1105 which requested this feature
Fix failure in Test_popup_command. The test assumes a certain PopUp menu
layout but we recently added a new "Look Up" menu item. Make sure the
test removes those non-standard menu items before progressing the test.
Also, while we are at it, make sure the showdefinition() command will
fail when not in GUI mode so it doesn't queue up the command queue.
Also, convert the E??? error codes to proper error codes (and using a
postfix "-M" to make sure they don't conflict with future Vim error
codes) so they can be looked up in documentation.
In macOS 13 Ventura, the general terminology of "Preferences" has been
renamed to "Settings". The main menu's "Preferences…" item is
automatically renamed to "Settings…" by the OS when building against the
macOS 13 SDK, but we still need to update documentation to match.
Problem: Kitty terminal is not recognized.
Solution: Recognize Kitty by the termresponse and then do not set
seenModifyOtherKeys, since Kitty doesn't support that.
(issue #11413)
Problem: With 'smoothscroll' typing "0" may not go to the first column.
Solution: Recompute w_cline_height when needed. Do not scroll up when it
would move the cursor.
Problem: 'langmap' works differently when there are modifiers.
Solution: Only apply 'langmap' to a character where modifiers have no
effect. (closes#11395, closes#11404)
Problem: The modifyOtherKeys flag is set when it should not.
Solution: Do not handle special key codes with a modifer value above 16 as a
modifyOtherKeys value. (issue #11403)
Problem: MS-Windows: mouse scroll events only work with the dll.
Solution: Accept CSI codes for MS-Windows without the GUI. (Christopher
Plewright, closes#11401)
Problem: At the hit-Enter prompt the End and Home keys may not work.
Solution: Use the special "@" code for End and Home, like it was done for
the cursor keys in patch 8.2.2246. (Trygve Aaberge, closes#11396)
Problem: ModeChanged autocmd not executed when Visual mode is ended with
CTRL-C.
Solution: Do not trigger the autocmd when got_int is set. (closes#11394)
Problem: MS-Windows: mouse scrolling in terminal misbehaves without dll.
Solution: Add #ifdef as a temporary solution. (Christopher Plewright,
closes#11392)
Problem: Text prop "above" not displayed correctly with 'number' and "n" in
'cpo'.
Solution: Draw the line number column until the line text is reached.
Problem: ":!" doesn't do anything but does update the previous command.
Solution: Do not have ":!" change the previous command. (Martin Tournoij,
closes#11372)
Problem: MS-Windows: mouse scrolling not supported in the console.
Solution: Add event handling for mouse scroll events. (Christopher
Plewright, closes#11374)
Problem: Some Ex commands are not in the help index.
Solution: Add the missing commands. Add a script to check all Ex commands
are in the help index. (Yee Cheng Chin, closes#11371)
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
This automatically uses NSDataDetector to detect special data around the
lookup cursor position, and if found, will manually call showDefinition
instead of letting the OS do it for us (honestly, this feature should be
built-in to the OS instead of such manual work). Right now only doing
address/phone number/URL (URL has priority), because we don't have
built-in definition support for the other types like flight info and so
on. This also only works for what is drawn on-screen only, because as
usual, MacVim doesn't have access to the native text storage, unless we
rely on lots of callbacks back-and-forth (which is possible, but
annoying to implement).
Doing data lookup (e.g. Ctrl-Cmd-D) on top of a selected text now
properly look up the entire selected range (e.g. "ice cream", instead of
just "ice" or "cream"). This would have come by default if we could
implement NSTextInputClient's selectedRange properly but since MacVim
doesn't have access to the internal Vim buffers easily this is easier
said than done. As such, we have a custom implementation where if we
detect a lookup event, manually detect that we have the mouse cursor on
top of selected text and show the definition for that manually.
Also fix a minor issue in text input client so that the baseline is now
reported correctly for certan font size comboes, as our fontDescent is
rounded up for some reason.
Problem: Breakindent test cases are commented out.
Solution: Adjust expected result to slightly different behavior. Correct
computations for cursor position.
Problem: Wrong cursor position when using "gj" and "gk" in a long line.
Solution: Adjust computations for the cursor position and skipcol. Re-enable
tests that pass now, disable failing breakindent test.
Problem: Mouse column not correctly used for popup_setpos.
Solution: Adjust off-by-one error and handle Visual line selection properly.
(Yee Cheng Chin, closes#11356)
Problem: Lisp word only recognized when a space follows.
Solution: Also match a word at the end of a line. Rename the test. Use a
compiled function to avoid backslashes.
Problem: Quickfix listing does not handle very long messages.
Solution: Use a growarray instead of a fixed size buffer. (Yegappan
Lakshmanan, closes#11357)
Problem: Cursor position invalid when scrolling with 'smoothscroll' set.
(Ernie Rael)
Solution: Add w_valid_skipcol and clear flags when it changes. Adjust
w_skipcol after moving the cursor.
Problem: Use of strftime() is not safe.
Solution: Check the return value of strftime(). Use a larger buffer and
correctly pass the available space. (Dominique Pellé, closes
#11348)
This adds support for looking up data under the mouse cursor. Usually it
will bring up a dictionary, but other times it could be a Wikipedia
article, Siri knowledge, etc. Apple doesn't really have a good name for
it, other than "looking up data", "quick look" (a confusingly similar
name with the other Quick Look OS feature), or "show definition". You
can activate this by doing Ctrl-Cmd-D when the mouse is over a cursor.
If you have a trackpad, you can also either activate this using Force
click or three-finger tap (depends on your system preference settings).
Note that for Force click, this could potentially make it impossible to
use the MacVim `<ForceClick>` mapping in Vim, which allows you to map a
force click to a Vim command (#716). This is handled by having a new
setting (under a new "Input" preference pane which will have more
populated later) that allows you to choose whether to use Force click
for data lookup or Vim's `<ForceClick>` mapping. If you have configured
to use three-finger taps though this setting wouldn't do anything, and
`<ForceClick>` is always send to the Vim mapping.
Also, this is lacking a lot of features that a normal macOS application
would get, e.g. looking up selected texts (e.g. if you have "ice cream",
you may want to select the whole thing to look up the phrase, rather
than just "ice" or "cream"), data detector, and much more (e.g. custom
API support). They will be done later as part of #1311.
Technical details below:
The way the OS knows how to look up the data and present it is by
talking to the NSTextInput/NSTextInputClient. Previously MacVim
implemented NSTextInput partially, and didn't implement the critical
firstRectForCharacterRange:actualRange and characterIndexForPoint:
functions. First, in this change we change from NSTextInput to
NSTextInputClient (which is the newer non-deprecated version), and
implement those functions, which allows the OS to query the text
storage.
By default, the OS sends a quickLookWithEvent: call to us whenever the
lookup happens but for some odd reason this isn't automatic for Force
clicks, presumably because some apps want to handle Force clicks
manually (this is why some apps only work for three-finger taps but not
Force clicks for lookups). This isn't documented but I found references
in iTerm/Firefox, and basically we just need to manually handle it and
send off quickLookWithEvent: when handling Force clicks.
For implementing the NSTextInputClient properly, the main issue is
making sure that can work properly with input methods / marked texts,
which is the other primary purpose for this class (other than inputting
keys). For data lookups, I'm representing the grid as a row-major text
(with no newline/space in between) and expose that to the OS. This
already has some issue because it doesn't handle Vim vertical splits
well, as MacVim doesn't really have access to detailed Vim text buffers
easily (unless we do a lot of calls back-and-forth). This means wrapped
texts won't be looked up properly, which I think is ok. Also, the OS
APIs deal with UTF-8 indices, so we can't just convert row/column to raw
indices and have to do a lot of character length calculations
(especially for wide chars like CJK or emojis) to make sure the returned
ranges are consistent and valid. For marked texts though, this presents
a challenge because Vim doesn't really have a strong enough API to
communicate back-and-forth about the marked positions and whatnot (it
only let the GUI know where the current cursor is), and it's hard to
implement APIs like `markedRange` properly because some marked texts
could be hidden or wrapped (if you implement some of these functions
improperly Apple's input methods could start misbehaving especially when
you use arrow keys to navigate). In the end I kept the original
implementation for treating the marked texts as a range starting from 0,
*only* when we have marked text. Kind of a hack but this makes sure we
work both in marked text mode (i.e. when inputting texts) and when doing
lookups. For simplicity I made it so that you can't do data lookups when
in marked text mode now.
Input method:
This change also fixes a quirk in input method as a driveby change.
Previously the logic for calculating the rect for where the candidate
list was quite broken, but now it's calculated correctly using the
desired range and the current cursor position. This matters when say
using Japanese IM and using the left/right arrow to jump to different
sections of the text. If the desired range is in a wrapped line, the new
logic would attempt to pin it to the left-most column of where the
cursor is in the range.
Data detection:
Note that the default implementation is quite bare, and lacks a lot of
smart data detection. For example, if you put your mouse over a URL, it
won't properly select the whole URL, and addresses and dates for example
also won't get grouped together properly. This is because these require
additional implementation (e.g. using NSDataDetector) instead of coming
"for free", and will be handled later. In fact, Apple's WebKit and
NSTextView cheats by calling an internal API framework called "Reveal"
(which you can find out by intercepting NSTextView's calls and/or
looking at WebKit's source code) which is much more powerful and
supports looking up package tracking, airline info, and more, but it's
not available to third-party software (that's why Safari's lookup is so
much better than Chrome/Firefox's).
This isn't tested right now. Future task needs to add XCTest support to
properly test this as there are a lot of edge cases involved here.
Fix#1191
Part of Epic #1311, which contains other items to be implemented.
Problem: Looping over list of lists and changing the list contents works in
Vim9 script, not in a compiled function.
Solution: Mark the loop variable final instead of const. (closes#11347)
Problem: Virtual text "after" wraps to next line even when 'wrap' is off
and 'list' is set.
Solution: Do not use the minimum width when 'wrap' is off. (issue #11336)
Problem: Closure in compiled function gets same variable in block.
Solution: At the end of a block to not always reset the variable count.
(issue #11094)
Problem: Extra empty line between two virtual text "below" when 'wrap' and
'number' are set.
Solution: Reset "before" when there is no text in the screen line.
(closes#11334)
Problem: With 'nowrap' virtual text "after" does not scroll left.
Solution: Skip part of the virtual text that is left of the window.
(closes#11320) Fix going beyond the last column of the window.
Problem: Wrong argument for append() gives two error messages.
Solution: When getting an error for a number argument don't try using it as
a string. (closes#11335)
Problem: With 'nowrap' two virtual text below not displayed correctly.
Solution: Set text_prop_follows before continuing. Correct for number
column. (closes#11333)
Problem: Wrong column when calling setcursorcharpos() with zero lnum.
Solution: Set the line number before calling buf_charidx_to_byteidx().
(closes#11329)
Problem: Quitting/unloading/hiding a terminal buffer does not always work
properly.
Solution: Avoid that ":q!" leaves an empty buffer behind. ":bunload!" also
kills the job and unloads the buffer. ":hide" does not unload the
buffer. (Yee Cheng Chin, closes#11323)
Since Vim upstream added support for `:confirm q` for terminals, we can
now get our File.Close menu to work properly for them as well. This also
means Cmd-W (which is bound to that menu item) works too.
Also just add validateMenuItem: for MMAppController even if we are just
returning YES. This makes it semantically clearer and is easier to
debug.
Problem: :confirm does not work properly for a terminal buffer.
Solution: Handle :confirm for a terminal buffer differently. (Yee Cheng
Chin, closes#11312)
Problem: With 'smoothscroll' and 'scrolloff' non-zero the cursor position
is not properly adjusted in a long line.
Solution: Move the cursor further up or down in the line.
Problem: There is no real need for a "big" build.
Solution: Move common features to "normal" build, less often used features
to the "huge" build. (Martin Tournoij, closes#11283)
Problem: Cursor in wrong position with Visual substitute.
Solution: When restoring 'linebreak' mark the virtual column as invalid.
(closes#11309, closes#11311)
We are using auto-enabling of menu items, which require each target of
macaction to implement validateMenuItem properly. It was done in
MMTextView, but not MMCoreTextView. Also, as part of fixing this up,
just add more comments, and make sure to call back to superclass etc to
make the code more robust.
Problem: "export def" does not work in a nested block.
Solution: Do not handle "export" with a separate function but in the same
command stack. (closes#11304)
Problem: The right ALT key does not work on some MS-Windows keyboards.
Solution: Adjust the modifiers based on GetKeyState(). (Anoton Sharonov,
closes#11300)
The existing emenu code has this odd exception where if you invoke it on
a menu with <Nop> bound in Vim, and has a macaction, it will call the
macaction instead. However, it's not properly handling the situation
when the menu is not bound for the mode and would crash when deferencing
a null string ptr. Move it to the proper spot and fix up a previous
upstream merge mistake (in Vim upstream, when you call :emenu on a <Nop>
menu item it just does nothing now, instead of complaining about it) so
that it all works correctly.
Problem: Cursor line only partly shows with 'smoothscroll' and 'scrolloff'
zero.
Solution: Do not use 'smoothscroll' when adjusting the bottom of the window.
(closes#11269)
Fix the deprecation warning on makeWindowsPerform. While we could simply
replace it with the more updated form, one thing I noticed was that
zoomAll: simply wasn't getting called. It appears that NSApplication has
a native handler of it and would call zoom: on each window by itself,
and as such there's no point in making our own zoomAll: method at all. I
couldn't find out if this was the case in old macOS versions, and so
just ifdef out the zoomAll function in newer versions of macOS which
also fixes the deprecation warning.
This is a little tricky because it's not a simple map. With
NSPasteboardTypeFileURL, we have to use readObjectsForClasses:options:
to obtain a list of URL objects and then turn them into file path
strings. Previously you could just get a list of file names directly
with NSFilenamesPboardType. Also, this new enum was only defined in
10.13, so we have to maintain parallel paths to support both types of
getting the list of file names from the pasteboard. Also refactored the
code that use this to a function in Miscllaneous.m to avoid the
headache. Note that the old NSFilenamesPboardType method still works
today, so this is mostly to clean up old code and deprecation warnings.
Also made the "new file here" plugin accept both the old and new
pasteboard types, just in case.
Seems like the flag has been completely useless since macOS 11. We
previously kept it around despite its deprecation status because it
seems to make the title bar not show a black line, but since macOS 11 it
has been showing that anyway, so remove usage of it. Also, clean up misc
pre-Lion-era code and block them behind ifdef. Can remove those code in
future if we want to clean up.
Refactor the code so that the relevant class is in header and can be
called. Also fix different places where I call NSClassFromString to use
@available check instead, as I believe that's the recommended method and
more efficient as well (due to it being native to the compiler).
The list of warnings fixed:
- Fix misc AppKit control states enums that got renamed and deprecated.
- NSFindPboardType -> NSPasteboardTypeFind deprecation.
- Fix usage of deprecated "graphicsPort" API to use CGContext instead.
- Use NSFontChanging protocol if it's available.
- Move MMCoreTextView's setcmdheight to the correct section in the private
implementation category.
This turned out more complicated than I thoguht because
the newer NSPasteboardTypeString (public.utf8-plain-text) is actually a
different value from NSStringPboardType (NSStringPboardType), so it
could potentially lead to behavior differences. The right-click Services
menu in particular seems to not behave in the expected way, because
writeSelectionToPasteboard: (called by the OS) is passing
NSStringPboardType to us, even though we specifically only accept
NSPasteboardTypeString in validRequestorForSendType:returnType:. Just
fixed the code to ignore the passed in type.
Also update the Info.plist file to accept the public.utf8-plain-text for
this service as well.
Make sure to specify the build phase (e.g. building locale files)
input/output dependencies so they can be properly skipped during
incremental builds if the input files haven't changed. Previously some
of them were set to use dependency tracking, but with no input/output
specified, therefore triggering a warning as Xcode had to run them every
build.
Fix NSStringPboardType and NSFindPboard deprecation warnings.
Also, fix up an awkward use of colors in that we are loading the ARGB
values of system colors using device calibrated space but CoreText
renderer uses sRGB instead. Just load it as sRGB.
This should fix up all Vim-side compiler warnings except for the usage
of NSConnection, which is a much larger task to tackle as we need to
move to XPC. Note that the set of warnings differ depending on whether
we have `MACOSX_DEPLOYMENT_TARGET=10.9` set or not as Xcode will
recommend different changes. With that set we currently do not throw any
warnings on the Vim process side (since NSConnection was not deprecated
at 10.9 yet).
Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution: Check the botline is not too large. (Luuk van Baal,
closes#11293, closes#11292)
Problem: Spacing-combining characters handled as composing, causing text to
take more space than expected.
Solution: Handle characters marked with "Mc" not as composing.
(closes#11282
Problem: Setting 'cmdheight' has no effect if last window was resized.
Solution: Do apply 'cmdheight' when told to. Use the frame height instead
of the cmdline_row. (closes#11286)
Problem: Multi-byte "lastline" item in 'fillchars' does not work properly
when the window is two columns wide.
Solution: Compute the text length correctly. (closes#11280)
Problem: Too many #ifdefs.
Solution: Graduate the +cmdwin feature. Now the tiny and small builds are
equal, drop the small build. (Martin Tournoij, closes#11268)
Problem: Cannot specify another character to use instead of '@' at the end
of the window.
Solution: Add "lastline" to 'fillchars'. (Martin Tournoij, closes#11264,
closes#10963)
Problem: When using powershell input redirection does not work.
Solution: Use a different shell command for powershell. (Yegappan
Lakshmanan, closes#11257)
Problem: The 'splitscroll' option is not a good name.
Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option,
also supporting "topline". (Luuk van Baal, closes#11258)
Problem: with 'smoothscroll' set CTRL-E does not work properly when
'foldmethod' is set to "indent". (Yee Cheng Chin)
Solution: Merge the code for scroling with folds and 'smoothscroll'.
(closes#11262)
I just missed the fact that getreg() also works and I don't need to hack
to use clip_convert_selection() and the mod on it. This is kind of...
odd, because clip_convert_selection() is essentially doing the same
thing as getreg() with *very* minor differences. You would hope that
would be consolidated and refactored into a single function, but of
course not.
Also cleaned up some comments to make it clear that evaluateExpression
probably would have worked except for the autocmd blocking part.
Problem: Checking for popup in screen_char() is too late, the attribute has
already been changed.
Solution: Move check for popup to where screen_char() is called.
Previously, whenever the user selects some text in MacVim, and then
bring up the Services menu (either by right-clicking on the selection,
or go to MacVim -> Services), MacVim will copy the selected text to the
system clipboard, which is quite an unexpected behavior. Fix that here.
Part of the issue is that Vim has built-in ways to convert the selected
range to a single copyable text, while managing complexities of dealing
with blockwise/linewise modes. Previous implementation in MacVim was
lazy in that it just invoked those code, but the side effect was that it
would also copy the text to the system clipboard and pollute Vim's star
register as well. This was quite undesirable because the user has not
done anything other than opening a menu and wouldn't have expected the
system clipboard or the Vim registers to have changed.
In this fix, we unfortunately had to do a little bit more copy-pasting
to extract the useful bits so we can copy the text to a register (but
not system clipboard), invoke the code to convert the register to
clipboard-happy text, restore the register, and then move on. A little
annoying but better than having the unintuitive / annoying behaveior
from before, and this way we don't have to do too much intrusive
refactoring of upstream Vim code as well.
Problem: Evaluating "expr" options has more overhead than needed.
Solution: Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
"expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
'formatexpr', 'indentexpr' and 'charconvert'.
Problem: Get an error for using const only when executing.
Solution: Check for const at compile time for filter(), map(), remove(),
reverse(), sort() and uniq().
Problem: matchaddpos() can get slow when adding many matches.
Solution: Update the next available match ID when manually picking an ID and
remove check if the available ID can be used. (idea by Rick Howe)
This was previously broken by #1287 as I did not update the new
constants' values.
Also, make strikethrough work in it.
The non-CoreText renderer is essentially deprecated and will be removed
in near future, but for now just fix up the straggling bugs since this
is easy to do so.
Fix#1296
Problem: Running source tests leaves file behind.
Solution: Add the "D" flag to writefile(). (Dominique Pellé, closes#11243)
Also do this for other writefile() calls and drop delete().
Problem: With spell checking, deleting a full stop at the end of a line
does not update SpellCap at the start of the next line.
Solution: Update the next line when characters have been deleted. Also when
using undo.
Problem: system() opens a terminal window when using the GUI and "!" is in
'guioptions'.
Solution: Do not use a terminal window when the SHELL_SILENT flag is used.
(closes#11202)
Problem: With 'nosplitscroll' folds are not handled correctly.
Solution: Take care of closed folds when moving the cursor. (Luuk van Baal,
closes#11234)
Problem: Cannot close a tab page with the middle mouse button.
Solution: Support closing a tab page with the middle mouse button, like many
other programs. (closes#10746)
Problem: Extra newline in messages after a verbose shell message.
Solution: Output the newline with msg_putchar_attr(). (closes#11233)
Make it possible to filter a screendump before comparing it.
Problem: Display not cleared when scrolling back in messages, a background
color is set and t_ut is empty.
Solution: Clear to the end of the display if needed. (closes#8973)
Problem: After exiting Insert mode spelling is not checked in the next
line.
Solution: When spelling is enabled redraw the next line after exiting Insert
mode in case the spell highlight needs updating.
Problem: Using freed memory when 'tagfunc' wipes out buffer that holds
'complete'.
Solution: Make a copy of the option. Make sure cursor position is valid.
Problem: Cannot easily get out when using "vim file | grep word".
Solution: Without changes let CTRL-C exit Vim. Otherwise give a message on
stderr. (closes#11209)
Problem: Cscope test causes problems when code for test timeout timer is
included (even when commented out).
Solution: Disable part of the cscope test for now.
Problem: Valgrind reports possibly leaked memory.
Solution: Move the problematic test function to the "fails" test file to
avoid obscuring real memory leaks.
Problem: Scrolling with 'nosplitscroll' in callback changing curwin.
Solution: Invalidate w_cline_row in the right place. (Luuk van Baal,
closes#11185)
Problem: Crash when closing a tabpage and buffer is NULL.
Solution: Adjust how autocommands are triggered when closing a window.
(closes#11198, closes#11197)
Problem: Declaring a loop variable at the start of a block is clumsy.
Solution: Declare the variable inside the loop in a few places to see if
this works.
Problem: When quitting the cmdline window with CTRL-C it remains visible.
Solution: Redraw to avoid confusion. Adjust the error message.
(closes#11152) Adjust the cursor position after CTRL-C.
Problem: Using "end_lnum" with virtual text causes problems.
Solution: Disallow using "end_lnum" with virtual text. (closes#11151)
Also disallow "end_col" and "length".
Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help
window closed.
Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal,
closes#11150)
Switch Sparkle's appcast URL to use macvim.org instead of raw GitHub
URL. This is more public facing, and gives us more power to maintain
control of the updater (as long as we keep control over the domain
name), and make it possible to migrate to other platforms from GitHub
(if we so wish in the future).
The current URL for the appcast is actually quite problematic as it for
some reason point directly to GitHub's raw content of the file, instead
of the version generated by GitHub Pages. That means we can't really
use GitHub Page's Jekyll static site generator to dynamically create the
file (latest.xml) as the raw URL directly reads the source code rather
than the generated link on GitHub Page (in which case I don't know why
we bothered to put in on a gh-page branch to begin with).
Since some people only open / update MacVim infrequently, that means we
can't really change latext.xml to be generated by Jekyll in foreseeable
future (at least a year or so) as we don't want to break not-too-old
MacVim versions' ability to update. The ability to dynamically generate
it would have been useful to handle legacy (pre-10.13) and beta
releases.
Problem: In a :def function all closures in a loop get the same variables.
Solution: Use a separate list of variables for LOADOUTER and STOREOUTER.
Not copied at end of loop yet.
Updated to Vim 9.0.472.
Announcements
====================
Sponsors
--------------------
MacVim now allows you to sponsor the team! Any amount would be
appreciated and it is of course optional. See the announcement (#1271)
for more details.
Supporting old versions of macOS (10.12 or below)
--------------------
Currently, macOS supports macOS 10.9 or above. However, this is getting
harder to do so as time goes on (e.g. the latest Xcode doesn't support
building for it). In the near future, MacVim will mostly target 10.13
(High Sierra) or above, with 10.9 - 10.12 as legacy support. Visit this
discussion (#1288) if you would be affected and would like to know more.
Features
====================
Resizing MacVim new options
--------------------
You can now smoothly drag and resize MacVim without having it
constrained to fixed multiples of the text size, by setting the
"Smoothly resizes window" under General preference pane. This also
allows MacVim to behave better when used with third-party tools (e.g.
BetterSnapTool) to snap it to one side of the screen. #1276
The command line can now be pinned to the bottom of the window with a
setting (under Appearance preference pane). This makes it look better
aligned when using smooth resizing, or in other situations where the
window size is not a direct multiples of Vim's text size (e.g. full
screen or guioption+=k). #1280
New supported text styles
--------------------
Vim highlight groups `strikethrough`, `underdouble`, `underdotted`,
`underdashed` are now supported. #1287
New Vim features
--------------------
Virtual text allows you to place custom texts to be displayed inline for
diagnostic information and more (e.g. build errors, CSS color preview).
See `:help virtual-text` for more information.
The default color schemes (e.g. desert) are now fixed to look correct
again.
Misc options and commands:
- `set nosplitscroll` lets you preserve the windows' scroll positions
when splitting. (v9.0.0445)
- `:defer` allows you to clean up in a function. (v9.0.0370)
- `:echowindow` allows you to echo a message to a floating popup message
window instead of to the command line. (v9.0.0321)
Fixes
====================
- Fixed non-native full screen not working well with the notch on newer
MacBook's when set to not show menu bar. You can also use
`MMNonNativeFullScreenSafeAreaBehavior` to force MacVim to use the
notch area as well if you don't mind some content being obscured. #1261
- Fixed bad interaction when two settings ("Open untitled window: never"
and "After last window closes: Quit MacVim") are set together. #1257
- Fixed the bundled Vim tutor not working when launching from the Help
menu #1265.
- Fix crashing on launch under macOS 10.9. #1212
- Fixed potential crash when switching appearance mode in MacVim
preferences. #1270
- Korean localized menus no longer throw a syntax error on launch. #1278
- `did_install_default_menus` should work in MacVim now. #1267
General
====================
Sparkle (updater for MacVim) is now updated to 1.27.1 (#1284), and we no
longer use DSA keys for signing updates (#1285) as we are using EdDSA
already.
Scripting
====================
- Scripting languages versions:
- Python is now built against 3.10, up from 3.9.
Compatibility
====================
Requires macOS 10.9 or above.
Script interfaces have compatibility with these versions:
- Lua 5.4
- Perl 5.18
- Python2 2.7
- Python3 3.10
- Ruby 3.1
Problem: In a :def function all closures in a loop get the same variables.
Solution: When in a loop and a closure refers to a variable declared in the
loop, prepare for making a copy of variables for each closure.
Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution: Skip win_fix_cursor if called when cmdwin is open or closing.
(Luuk van Baal, closes#11134)
Add support for all the missing text styles for MacVim for Vim parity.
For strikethrough, this needed to be done as a second pass to make sure
they get drawn on top of the text. This is necessary because currently
the logic buffers texts up before dispatching them later in a line, so
it's just easier to loop through the line a second time if we detected
strikethrough. For the strikethrough position, we simply use the half of
xheight which seems to work best in looking good.
For underdouble, the logic is a little tricky because sometimes we don't
have space below the line. When that's the case, simply draw the second
line on top of the first line.
For underdotted, need to do something smart to space out the dots. When
the width is divisible by 2, they get spaced out evenly. If they are
not, try to make it work if divisible by 3. If that's not the case, we
just readjust the size of dot/gap a little bit to make it fit, even
though now we have non-integer sizes (from experimentation, the
antialising works well enough that it's not too jarring).
Also fix rendering of undercurl to work for double-width characters as
well.
Note that underdouble/underdotted/underdashed are not supported in
regular gVim yet, and so I had to add the ifdef for those in gui.c.
These may cause merge conflicts later which should be easily resolved.
Known issue 1: Note that currently underline is not respecting the
font's underline thickness and position. We always use a thickness of 1
pt, and hard-code a 0.4*descent position, which are not great. Thickness
in particular should scale with the font size. They should be fixed in a
future commit.
Known issue 2: There are some current clipping bugs in the renderer.
This is because the line height returned by NSLayoutManager is sometimes
smaller than ascent+descent+leading, *and* MMCoreTextView for some
reason takes the `ceil(descent)` (presumably to make the rendering
grid-aligned). This should be fixed later.
Fix#1034
Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off.
Solution: Temporarily set 'splitscroll' when jumping back to the original
window. (closes#11128)
We previously added a step to rebuild the Vim help tags when publishing
so that we could get the latest tags when generating a MacVim release
(sometimes Vim's runtime is lagging behind and doesn't have that done).
However, the step was so placed so far back (after building/testing)
that it doesn't actually do anything, as MacVim was already built. Move
it earlier so we build MacVim after vimtags are re-generated. As part of
doing this we also need to split building Vim itself earlier as vimtags
generation requires having a Vim binary.
So the updated steps are 1. Vim, 2. help tags, 3. MacVim, 4. Tests.
Previously they were 1. Vim/MacVim, 2. Tests, 3. help tags.
Problem: Visual highlighting extends into virtual text prop.
Solution: Do not highlight what isn't actually selected. Fix ordering of
stored text props.
Sparkle has deprecated signing updates with DSA for a long time. MacVim
has also added an EdDSA key for a while now. This means we can remove
the DSA key and still be pretty safe and certain that vast majority of
MacVim users can still update from old versions of MacVim to the new
one, using only the EdDSA key. This makes the update process easier and
we don't have to use legacy tools to sign each update with the
deprecated DSA key.
This is the last 1.x version. Upgrading to it to get all remaining fixes
before we need to decide whether whether we upgrade to 2.x (which has
much higher minimum macOS requirements).
CI build has been updated to build MacVim against Python 3.10, so we
want to update the other detection to use 3.10 as well. Also added a
comment to CI file to make sure we remember to update the vimrc file
when updating the version.
Add a setting that could pin the command-line portion of Vim to the
bottom of the MacVim window. This is useful when smooth resizing is set,
guioption+=k, or in full screen. In those situations, the MacVim window
size is usually not direct multiples of the Vim text sizes. Previously
the command-line would be drawn like other texts, and hence not aligned
to the bottom and hence looking aesthetically a little off.
When this setting is set, the command-line portion would be aligned to
the bottom of the window. This essentially moves the gap (due to the
extra height of the window) from the bottom to be between cmdline and
the rest of Vim. When cmdheight is changed, or other situations (e.g.
typing too much cmdline height to be increased), the gap will be
adjusted as well.
Implementation-wise, this was done by passing the `commandline_row` var
from Vim to MacVim, which serves as a good estimate of where the
command-line is. This works better than just using the `cmdheight`
option as it is closer to the current state of the cmdline. One issue is
that in hit-enter prompts, the row is set to the 2nd to last row to
anticipate more messages, and we just add a big hack by incrementing the
row by 1 in hit-enter state so only the "Press Enter..." part is aligned
to bottom. We also have to do something similar to when it's showing
"--more--" for similar reasons.
- An alternative would have been to modify Vim to provide us the
information we want (the number of rows below the status line) but
it's pretty tricky to do as cmdline_row is used in lots of places.
It's easier / simpler to do a simple hack like this to localize the
damage.
Close#833
The recent change that added smooth resizing changed the alignment for
the General preference pane from bottom to top aligned as it never made
sense to be bottom aligned. However, there was code in in the preference
controller to correct for that when resizing the pane when sparkle is
disabled, which caused the resizing to not work. Fix that to account for
the top alignment instead of bottom.
Fix#1281
Problem: Using :echowin while at the hit-enter prompt causes problems.
Solution: Do not prompt for :echowin. Postpone showing the message window.
Start the timer when the window is displayed.
Problem: When opening/closing window text moves up/down.
Solution: Add the 'splitscroll' option. When off text will keep its
position as much as possible.
Problem: Crash when using mkdir() with "R" flag in compiled function.
Solution: Reserve a variable for deferred function calls. Handle more than
one argument.
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
Adds a setting that allows for smoothly resizing the window. Previously,
MacVim would only allow resizing in fixed increment of the grid size and
snap to such sizes. This was a little more consistent with how terminals
tend to work, and allows for optimal window sizing, and it was also an
artifact of the old MacVim renderer where it didn't have a stateful
renderer that could repaint the text view.
The snapping could be jarring for users more used to modern text editors
which allow for smoothly resizing of the window though, and it makes
third party tools that could snap macOS windows to the side not work
properly as there's usually a gap near the bottom. With guioption-k,
MacVim already allows for decoupling the window size from the Vim's grid
size anyway, so adding smooth resizing allows to work much better under
those assumptions.
In addition to allowing smooth resizing, this change also makes it so
that the CoreText renderer will fill to the right a little bit when
rendering the rightmost column when MacVim's window size isn't exactly
the Vim grid size. Previously, if a color scheme has NonText color (e.g.
desert), or the user has 'cursorline' set, smooth resize (or in full
screen or guioption-k) would leave a gap to the right, looking a little
ugly. This allows the last column's to fully fill to the right,
resulting in a much more consistent look when resizing the window.
Close#948
Problem: Cursor wrong if inserting before line with virtual text above.
Solution: Add the width of the "above" virtual text to the cursor position.
(issue #11084)
Problem: "for" and "while" not recognized after :vim9cmd and :legacy.
(Emanuele Torre)
Solution: Recognize all the command modifiers. (closes#11087)
Add a test to check the list of modifiers.
Problem: The :defer command does not check the function argument count and
types.
Solution: Check the function arguments when adding a deferred function.
Problem: matchstr() still does not match column offset when done after a
text search.
Solution: Only use the line number for a multi-line search. Fix the test.
(closes#10938)
Problem: Only created files can be cleaned up with one call.
Solution: Add flags to mkdir() to delete with a deferred function.
Expand the writefile() name to a full path to handle changing
directory.
Problem: :defer not tested with exceptions and ":qa!".
Solution: Test :defer works when exceptions are thrown and when ":qa!" is
used. Invoke the deferred calls on exit.
Problem: Cygwin: multibyte characters may be broken in terminal window.
Solution: Adjust how to read and write on the channel. (Ken Takata,
closes#11063)
Problem: repeating a <ScriptCmd> mapping does not use the right script
context.
Solution: When using a mapping put <SID>{sid}; in the redo buffer.
(closes#11049)
Problem: GUI: when CTRL-D is mapped in Insert mode it gets inserted.
(Yasuhiro Matsumoto)
Solution: Also recognize modifier starting with CSI. (closes#11057)
Problem: Coverity warns for NULL check and unused return value.
Solution: Remove the NULL check, it was already checked earlier. Add (void)
to ignore the return value.
Problem: Removing a listener may result in a memory leak and remove
subsequent listerns.
Solution: Init the "prev" pointer only once. (Yegappan Lakshmanan,
closes#11039)
Problem: 'linebreak' interferes with text property highlight if there is
syntax highlighting.
Solution: Check the text prop attributes after combining with syntax
attributes. (closes#11035)
Problem: :echowindow sets the in_echowindow flag too early.
Solution: Set in_echowindow only when outputting the text. (Yasuhiro
Matsumoto, closes#11033)
Problem: MS-Windows: cannot set cursor shape in Windows Terminal.
Solution: Make cursor shape work with Windows Terminal. (Ken Takata,
closes#11028, closes#6576)
Problem: ColorScheme autocommand triggered when colorscheme is not found.
(Romain Lafourcade)
Solution: Only trigger ColorScheme when loading the colorscheme succeeds.
(closes#11024)
Problem: ":wincmd =" equalizes in two directions.
Solution: Make ":vertical wincmd =" equalize vertically only and
":horizontal wincmd =" equalize horizontally only.
Problem: Some changes for cmdheight=0 are not needed.
Solution: Revert resize behavior if height is greater than the available
space. (Shougo Matsushita, closes#11008)
Problem: When updating the whole screen a popup may not be redrawn.
Solution: Mark the screen and windows for redraw also when not clearing.
Also mark popup windows for redraw.
Problem: Output of :messages dissappears when cmdheight is zero.
Solution: Do not use the messages window for :messages. Make Esc close the
messages window.
Problem: It is not easy to get information about a script.
Solution: Make getscriptinf() return the version. When selecting a specific
script return functions and variables. (Yegappan Lakshmanan,
closes#10991)
Problem: Cursor position wrong after right aligned virtual text. (Iizuka
Masashi)
Solution: Take the width of the column offset into account. (closes#10997)
Also fix virtual text positioning.
Problem: Message in popup is shortened unnecessary.
Solution: Do not use 'showcmd' and 'ruler' for a message in the popup.
Set the timer when unhiding the message popup.
Problem: Crash when 'cmdheight' is 0 and popup_clear() used.
Solution: Reset "message_win" when the message popup is cleared. Close the
popup when 'cmdheight' is non-zero. Add a screendump test.
Problem: BufReadCmd not triggered when loading a "nofile" buffer. (Maxim
Kim)
Solution: Call readfile() but bail out before reading a file.
(closes#10983)
Problem: getscriptinfo() does not include the version. Cannot select
entries by script name.
Solution: Add the "version" item and the "name" argument. (Yegappan
Lakshmanan, closes#10962)
Problem: bufload() reads a file even if the name is not a file name. (Cyker
Way)
Solution: Do not read the file when the buffer name is not a file name.
(closes#10975)
Problem: A symlink to an autoload script results in two entries in the list
of scripts, items expected in one are actually in the other.
Solution: Have one script item refer to the actually sourced one.
(closes#10960)
Problem: Mechanism to prevent recursive screen updating is incomplete.
Solution: Add "redraw_not_allowed" and set it in build_stl_str_hl().
(issue #10952)
Problem: Cannot make a funcref with "s:func" in a def function in legacy
script.
Solution: Allow for using a lower case function name after "s:". (Kota Kato,
closes#10926)
Problem: Splitting a line may duplicate virtual text. (Ben Jackson)
Solution: Don't duplicate a text property with virtual text. Make
auto-indenting work better. (closes#10919)
Problem: Cursor in wrong position when inserting after virtual text. (Ben
Jackson)
Solution: Put the cursor after the virtual text, where the text will be
inserted. (closes#10914)
Problem: cursor in a wrong positoin if 'wrap' is off and using two right
aligned text props in one line.
Solution: Count an extra line for a right aligned text property after a
below or right aligned text property. (issue #10909)
If a PR or issue has been tagged with "Response Needed" on GitHub, this
will auto-mark as stale in 45 days, and then close it in 7 days
afterwards. This allows us to simply mark an issue as "Response Needed"
and not need to come back after a while to close the issue which is time
consuming and easy to forget, leading to lots of stale open issues.
Don't turn this on for all issues. Only do this for those explicitly
tagged as needing response.
Problem: Search and match highlgith interfere with virtual text highlight.
(Ben Jackson)
Solution: Check for match highlight after text properties. Reset and
restore search highlight when showing virtual text.
(closes#10892)
Problem: Possible invalid memory access when 'cmdheight' is zero. (Martin
Tournoij)
Solution: Avoid going over the end of w_lines[] when w_height is Rows.
(closes#10882)
Problem: Messages test fails; window size incorrect when 'cmdheight' is
made smaller.
Solution: Properly cleanup after test with cmdheight zero. Resize windows
correctly when 'cmdheight' gets smaller.
Problem: The way 'cmdheight' can be made zero is inconsistent.
Solution: Only make 'cmdheight' zero when setting it explicitly, not when
resizing windows. (closes#10890)
This happens when changing appearance mode (e.g. transparent title bar)
and you could get to a state where the title is released before retained
again. Fix the order of operation to retain first. Probably another
reason why we really should have switched to ARC.
Problem: Virtual text without highlighting does not show. (Ben Jackson)
Solution: Use a text property when it has highlighting or when it has text.
(closes#10878)
Problem: Cursor position wrong with virtual text before Tab.
Solution: Use the byte length, not the cell with, to compare the column.
Correct tab size after text prop. (closes#10866)
Problem: Cursor position wrong with 'virtualedit' and mouse click after end
of the line. (Hermann Mayer)
Solution: Do not use ScreenCols[] when 'virtualedit' is active.
(closes#10868)
Problem: Spell checking for capital not working with trailing space.
Solution: Do not calculate cap_col at the end of the line. (Christian
Brabandt, closes#10870, issue #10838)
This fixes MacVim to work again on OSX 10.9. It was previously crashing
on launch for last few versions.
titlebarAppearsTransparent call: This API was added in 10.10, and
previously MacVim wasn't properly guarding it with the proper OS version
check, causing it to crash under 10.9 (which is the lowest currently
supported macOS version).
CGContext call: The new stateful renderer is using a newer API to
retrieve the CGContext from the NS wrapper, but that was also only added
in 10.10. When compiling against older versions, just use the older,
now-deprecated API "graphicsPort" instead. It still works.
Also, change the version check for `safeAreaInsets` for non-native full
screen to use `@available` as well instead of checking for selector.
This is more consistent with how other code works and fixes a compiler
warning about not checking for OS version.
Fix#1212
The `macaction` blocks were previously not respecting the
`did_install_default_menus` setting. If you set it to 1 in your vimrc,
MacVim would throw startup errors about macmenu not finding the menu
items it expected to. Move the `macaction` setup to the correct place so
they would only be called if `did_install_default_menus` is not 1.
Close#1231. Originally pull request by @jpetrie.
Problem: Cursor positioned wrong with two virtual text properties close
together. (Ben Jackson)
Solution: Add the original size, not the computed one. (closes#10864)
Problem: No fold and sign column for virtual text with "below" align and
'nowrap'.
Solution: Go back to draw state WL_START when moving to the next line.
(closes#10851)
Problem: Error for using #{ in an expression is a bit confusing.
Solution: Mention that this error is only given for an expression.
Avoid giving the error more than once. (closes#10855)
Problem: Test for fuzzy completion fails sometimes.
Solution: Use a more specific file name to minimize the chance of matching a
random directory name. (closes#10854)
Previously, the "Help.Vim Tutor" menu was using `:!vimtutor -g &`, but a
change in Vim (v8.2.3502) broke that behavior, as the whole script will
get terminated as soon as `:!` finishes running. Fix that to use `:call
system('vimtutor -g &')` instead, since that still works. See
https://github.com/vim/vim/issues/8951 for more discussions.
Add the MacVim Vim files (gui_macvim.m, MMBackEnd.m, MacVim.m) to the
list of GUI src files and then re-run `make depend` to regenerate all
dependencies. This does mean there will be an extra step in the future
for merging from upstream as we probably need to run `make depend`
relatively frequently, basically every time Vim changes dependencies
upstream.
Problem: Cursor positioned wrong after two text properties with virtual
text and "below" alignment. (Tim Pope)
Solution: Do not stop after a text property using MAXCOL. (closes#10849)
Problem: "delmenu" does not remove autocmmands. Running menu test function
alone fails.
Solution: Delete autocommands Make sure there is at least one menu.
(closes#10848)
Problem: Truncating virtual text after a line not implemented.
Cursor positioning wrong with Newline in the text.
Solution: Implement truncating. Disallow control characters in the text.
(closes#10842)
Previously, if you configure MacVim to never open an untitled window on
launch, *and* terminate MacVim on last window closing, you could get an
odd behavior where MacVim will close itself soon after launch, usually
when you fiddle with "About MacVim" or the preference pane. This isn't
too big a deal but could potentially make it hard to change the
preference back, and it's hard to know if a future macOS update will
further break this behavior causing MacVim to keep terminating itself on
launch (the termination behavior relies on the
`applicationShouldTerminateAfterLastWindowClosed` API which is
controlled by the OS).
To fix this, simply make it so that the preference pane doesn't allow
both settings to be set at once. If the user is trying to do so, set the
other setting to be something sane. Also, in the
`applicationShouldTerminateAfterLastWindowClosed` behavior, make sure we
add additional protection so that it will not return true when we are
set to never open untitled window (this should only be the case if the
user manually set it using `defaults` because we are now already
protecting against this in the preference pane logic). This should be
fine because these two setting don't really make sense for the user
anyway. It doesn't seem to make a lot of sense for the user to want this
behavior.
Note that I'm doing manual checking in preference UI instead of using
some sort of key-value listening of NSUserDefaults because I'm afraid of
some unintentional infinite recursion going on where the settings keep
setting each other back and forth. By only doing this at preference pane
changes this should not happen.
Fix#1257
This makes sure non-native full screen mode will not use the areas with
the notch (which exists in new Apple Silicon MacBooks) when menu bar is
configured to not show during non-native full screen. Previously it will
use the whole screen which resulted in some texts being clipped by the
sensor bar / "notch".
Add a new option `MMNonNativeFullScreenSafeAreaBehavior` which allows
the user to get the old behavior back by setting it to 1. This allows
for maximum display area on a MacBook display, but some content will be
obscured by the notch and the rounded corners. This is a
command-line-only option for now as it's relatively niche. In the future
we could potentially add new types of behaviors (such as showing the tab
bar or toolbar in the notch area).
Also, fix a manual one-pixel offset in the old menu bar size calculation
which was a hack to align things to hide the first row of pixels (which
arguably looks better if cursorline is on) but it was actually
incorrect. Just don't do the one-pixel hack.
Problem: Expanding file names fails in directory with more than 255
entries.
Solution: Use an int instead of char_u to count. (John Drouhard,
closes#10818)
Problem: Text of removed textprop with text is not freed.
Solution: Free the text when the property is removed. Reduce the array size
to ignore NULLs at the end.
Problem: The command line takes up space even when not used.
Solution: Allow for 'cmdheight' to be set to zero. (Shougo Matsushita,
closes#10675, closes#940)
Problem: Writing over the end of a buffer on stack when making list of
spell suggestions.
Solution: Make sure suggested word is not too long. (closes#10812)
Problem: If running configure with cached results -lrt may be missing.
Solution: Use two cache variables, one without and one with -lrt.
(closes#10799) Swap checks to avoid adding -lrt unnecessarily.
Problem: MS-Windows: CTRL-[ on Belgian keyboard does not work like Esc.
Solution: Figure out what the key code means. (Anton Sharonov,
closes#10687, closes#10454)
Problem: Using "terraform" filetype for .tfvars file is bad.
Solution: use "terraform-vars", so that different completion and other
mechanisms can be used. (Radek Simko, closes#10755)
Problem: Command line completion of user command may have duplicates.
(Dani Dickstein)
Solution: Skip global user command if an identical buffer-local one is
defined. (closes#10797)
Problem: Star register is changed when deleting and both "unnamed" and
"unnamedplus" are in 'clipboard'.
Solution: Make the use of the star register work as documented. (Ernie Rael,
closes#10669)
Problem: When switching window in autocmd the restored cursor position may
be wrong.
Solution: Do not restore the cursor if it was not set. (closes#10775)
Problem: Command overlaps with printed text in scrollback.
Solution: Clear until end-of-line and use correct message chunk.
(closes#10765, closes#10764)
**Please do not report security vulnerabilities through public GitHub issues.**
To report a security vulnerability for MacVim, please either email security@macvim.org, or visit https://github.com/macvim-dev/macvim/security/advisories/new.
" varname<g:netrw_ftp_browse_reject> value=^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$ ~1
" Description: "If you believe the journalists, he's the single wealthiest individual, period. As rich as some zaibatsu. But there's the catch, really: is he an individual? In the sense that you are, or I am? No." -- William Gibson, Count Zero
*digraph.txt* For Vim version 9.0. Last change: 2021 Jul 19
*digraph.txt* For Vim version 9.0. Last change: 2023 Mar 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -162,7 +162,7 @@ These are the RFC1345 digraphs for the one-byte characters. See the output of
":digraphs" for the others.
EURO
*euro* *euro-digraph*
Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was
added for this. Note the difference between latin1, where the digraph Cu is
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
@@ -547,7 +547,7 @@ char digraph hex dec official name ~
Θ H* 0398 0920 GREEK CAPITAL LETTER THETA
Ι I* 0399 0921 GREEK CAPITAL LETTER IOTA
Κ K* 039A 0922 GREEK CAPITAL LETTER KAPPA
Λ L* 039B 0923 GREEK CAPITAL LETTER LAMDA
Λ L* 039B 0923 GREEK CAPITAL LETTER LAMDA (aka LAMBDA)
Μ M* 039C 0924 GREEK CAPITAL LETTER MU
Ν N* 039D 0925 GREEK CAPITAL LETTER NU
Ξ C* 039E 0926 GREEK CAPITAL LETTER XI
@@ -578,7 +578,7 @@ char digraph hex dec official name ~
θ h* 03B8 0952 GREEK SMALL LETTER THETA
ι i* 03B9 0953 GREEK SMALL LETTER IOTA
κ k* 03BA 0954 GREEK SMALL LETTER KAPPA
λ l* 03BB 0955 GREEK SMALL LETTER LAMDA
λ l* 03BB 0955 GREEK SMALL LETTER LAMDA (aka LAMBDA)
μ m* 03BC 0956 GREEK SMALL LETTER MU
ν n* 03BD 0957 GREEK SMALL LETTER NU
ξ c* 03BE 0958 GREEK SMALL LETTER XI
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.