Updated to Vim 9.1.1128
This update contains a completely new GUI tabs implementation by @sfsam!
It also contains lots of small fixes for window resizing and full screen
mode that aims to make using MacVim feel rock solid and stable.
Defaults Change
====================
New settings defaults related to window sizing #1528:
- "Smoothly resizes window" is now on by default. MacVim's window will
now resize smoothly instead of snapped to the size of the character
grid.
- Vim's `guioption` now has `k` set by default (`:h go-k`). This
prevents MacVim's window size from changing unnecessarily when
showing/hiding tabs or changing font size.
These should align MacVim better with how other apps work and integrate
better with OS window management, including macOS 15 Sequoia's window
tiling feature.
Features
====================
Tabs
--------------------
MacVim has a new tabs implementation! The old version (PSMTabBarControl)
is not maintained and lacks features such as overflowing tabs and
customizable colors. The new tabs will overflow horizontally and are
scrollable. They also animate when tabs are closed or moved, respect
system settings such as right-to-left locales and high-contrast modes,
and are designed to fit within the currently selected Vim colors.
There are a few ways to customize the colors of the new tabs, under the
"Appearance" settings pane. MacVim defaults to an "Automatic colors"
mode which tries to pick sensible colors automatically based on the
current foreground/background colors. However, you can also configure it
to simply use the tab colors specified by the Vim color scheme (some
color schemes will work better than others depending on their choice of
colors). Another new option is "Use tabs background color" which when
combined with "Transparent title bar" allows the title bar and tabs to
look like a single cohesive whole.
Relevant work:
- #1120 (by @sfsam)
- Also: #1535 / #1536 / #1537 / #1538 / #1539 / #1557 / #1558 / #1560
New Vim features
--------------------
- new bundled color scheme:
- unokai (vim/vim#16443)
- new bundled optional plugins (use `packadd` to enable them):
- helptoc: Use `:HelpToc` to show an interactive table of contents
for Vim help, man pages, Markdown files, and terminal.
vim/vim#10446
- new options:
- `set diffopt+=linematch:{n}`. Matches lines better when in diff
mode. v9.1.1099
- `findfunc`. Customizes `:find` and other commands. v9.1.0831
- `set completeopt+=preinsert`. Preview inserted text in completion.
v9.1.1056
- `messagesopt`. Allows customizing hit-enter behavior. v9.1.0908
- new functions:
- `getcellpixels()`. Query the pixel size of a character cell in the
grid. v9.1.0854 / #1554 / #1555
- Vim tutor has a new interactive plugin (v9.1.0836). There is also now
a chapter 2 (vim/vim#5729).
Misc New Settings
--------------------
- "Open untitled window" (General) has a new option to only open on
MacVim re-activation. #1509
- "Show document icon at title bar" (Appearance). Previously MacVim
implicitly hid the document icon when using transparent title bar.
This is now customizable. #1510
General
====================
- The MacVim dmg installer has a new design. Courtesy of @jasonlong.
#1540#1545
- Legacy builds (macOS 10.9 - 10.12) are no longer built by GitHub
hosted runners, due to GitHub's deprecation of old runners. They are
now built by a custom self-hosted VM instead. In the future we hope to
set up reproducible builds (#1506) so it will not matter who's
building the app as it would be verifiable. #1559
- "Nightly" build: We now build a dmg installer for every commit. This
allows for trying out the latest developmental version of MacVim, but
note that the app will not be signed / notarized, and it will not be
as polished as official release/pre-release builds. See
[wiki](https://github.com/macvim-dev/macvim/wiki/Installing) for
instructions. #1532
Fixes
====================
Apple "Intelligence" Writing Tools
--------------------
macOS 15 Sequoia's Apple "Intelligence" Writing Tools should work
correctly with MacVim now. To use it, select some text, right click to
show menu, and then select the "Writing Tools" sub-menu. As part of this
fix, the integration with the "Services" menu now works more reliably as
well. You can select texts in blockwise visual mode and select a service
and MacVim will try to place the new texts back to the blockwise
selection if possible. #1552
Window resizing and full screen
--------------------
- Flicker begone: Changing font size, showing/hiding tabs or scroll
bars, or entering non-native full screen should no longer cause MacVim
to flicker. Previously there could be a momentary but
distracting/annoying stale image that flashes briefly. #1547#1549
- Fixed issue where resizing MacVim window would occasionally cause Vim
to be stuck in a stale wrong size. #1518
- Non-native full screen now supports `blurradius` option. #1546
- Fixed window size not always restoring correctly when exiting full
screen. Non-native full screen also works more reliably in
multi-monitor setup. #1525
- Fixed non-native full screen mode when using an external monitor with
a MacBook with a notch, and having the "Show menu bar in non-native
mode" option set. Previously MacVim would sometimes miscalculate the
menu bar height in the second screen. #1548
- Fixed misc issues with non-native full screen's interaction with
`fuoptions` and also the `transparency` setting, and rare crash. #1521
Other Fixes
--------------------
- Fixed issue where changing font size (using Cmd =/-) with guifont set
to "-monospace-" would result in guifont being changed to a confusing
name like ".AppleSystemUIFontMonospaced-Regular". #1544
- "MacVim Website" menu item now goes to the updated URL. #1524
- What's New page now allows changing font size (using Cmd =/-), and
showing table of contents. #1561#1562
- Dark mode documentation is now a bit clearer on `v:os_appearance`.
#1511
- Using dictionary look up on selected texts (by right clicking and then
selecting "Look Up" in the pop-up menu) is now more resilient as it
uses Vim's native `getregion()` to determine the selected texts. #1508
Scripting
====================
- Scripting languages versions:
- Ruby is now built against 3.4, up from 3.3.
- Perl is now built against 5.34, up from 5.30.
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.34
- Python2 2.7
- Python3 3.9 or above
- Ruby 3.4
In a normal HTTP URL the port will be nil, which doesn't equal itself.
This bug was introduced by #1561 when it tried to add more granular
comparison to URL checking to allow for anchor links.
The new native commenting functionality is currently not used when
editing mail. One could reasonably expect it to change the "quote" state
of any given line in the mail (i.e. the preceding ">"), which would be
very handy and feel natural when editing mail. Especially since the
current file already uses "setlocal comments+=n:>".
Solution: Add commentstring to `> %s` to be used in files of type mail.
closes: #16669
Signed-off-by: Lucas Eekhof <105216949+eekhof@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: patch 9.1.1119 caused a regression with imports
(girishji)
Solution: revert the script ID change for the class script variable for
now (Yegappan Lakshmanan)
fixes: #16664closes: #16670
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: when 'completeopt' is set to preinsert the preinserted text is
not cleared when adding new leader (Yee Cheng Chin)
Solution: add a condition to delete preinsert text in edit function
(glepnir)
closes: #16672
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: patch 9.1.1121 used a wrong way to handle enter
Solution: compl_enter_selects also needs to consider the selected item
in ins_compl_new_leader() (glepnir)
closes: #16673
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cannot loop through pum menu with multiline items with
fuzzy and noselect in 'completeopt' (Tomasz N)
Solution: remove unnecessary compl_no_select condition (glepnir)
fixes: #16641closes: #16674
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: No test for 'listchars' "precedes" with double-width char.
Solution: Add a test and fix a typo in code (zeertzjq).
closes: #16675
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Highlight groups PopupSelected/PopupNotification/
MessageWindow are supposed to fall back to default highlight
groups if they are not defined. However, once a colorscheme
has defined them, switching to another colorscheme that
doesn't do so will leave behind a cleared colorscheme, which
causes the fallback to fail.
Solution: Set up default links to the relevant fallback highlight
groups, which makes sure a `:hi clear` command will reset the
state properly (Yee Cheng Chin).
closes: #16676
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/dosini.vim supports both ; and # as comments, and I think
a bunch of the files detected as dosini do too, so add support for # to
the ftplugin.
closes: #16681
Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Fix hover buttons to not keep setting image on itself everytime a fg
color is changed, leading to each image referring to the last one. If a
display changed happens and macOS triggers a redraw, this could
sometimes lead to a stack overflow crash.
Just simplify the code and properly separate out the image template and
the derived images. This also makes sure we properly free the old
images when we change fg color where we discard the last image and make
a new one.
MacVim legacy builds target macOS 10.9, which needs Xcode 14.0.1 or
below. However, GitHub Actions no longer has a runner that has that
installed as macos-12 was removed and macos-13 has newer Xcode versions.
We are setting up a custom self-hosted runner that has Xcode 14.0.1
installed and configure GitHub Actions to use that to build legacy
builds. Only do this when making a full release because this has to be
spun up manually.
One big problem with setting up such a workflow is that GitHub Actions'
workflow syntax does not provide a way to selectively skip certain
matrix configuration in the `runs-on` field. The cleanest solution
(which is still quite messy) is to refactor the build-and-test step into
a separate reusable workflow, and have the parent workflow invoke it
with a "skip" boolean flag for each matrix entry. The child workflow
will then use that to selectively decide to run the job or not. It does
mean the CI YAML file is now split into two. This does have some
benefits since if we want to add reproducible builds in the future
(#1506) this would allow us to set up a new workflow that builds MacVim
the same way when a new release is made and verify that it's been built
properly.
Problem: too many strlen() calls in findfile.c
Solution: refactor findfile.c and remove calls to strlen()
(John Marriott)
closes: #16595
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Enter does not insert newline with "noselect" when the pum is
visible (lifepillar)
Solution: When Enter is pressed and no complete-item is selected,
ins_compl_prep returns false, and the edit function continues
processing Enter to insert a new line. (glepnir)
fixes: #1653closes: #16653
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
If $MYVIMDIR is unset netrw creates a directory called '$MYVIMDIR' in
the current directory
fixes: #16609
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: Not able to use an autoloaded class from another
autoloaded script (Elliot)
Solution: make it work (Yegappan Lakshmanan)
fixes: #15031closes: #16652
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_termcodes fails
(after: v9.1.1114)
Solution: adjust the test for the expected termguicolors value
Signed-off-by: Christian Brabandt <cb@256bit.org>
Contain the vimNotation syntax group, matching this at top level is
unnecessary and very slow.
The removed vimString and vimNumber definitions are broken and/or never
match. They have long been replaced by newer definitions.
closes: #16645
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: there are a few minor style issues
Solution: fix the issues (Hirohito Higashi)
closes: #16646
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: super not supported in lambda expressions
(Aliaksei Budavei)
Solution: Support using the super keyword in a closure in an instance
method (Yegappan Lakshmanan)
fixes: #16586closes: #16647
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: use-after-free in str_to_reg()
(fizz-is-on-the-way)
Solution: when redirecting the :display command, check that one
does not output to the register being displayed
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-63p5-mwg2-787v
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: enabling termguicolors automatically confuses users. Since
querying the terminal for the RGB flag happens asynchronously,
enabling termguicolors is noticeable by users as the highlighting changes
and is therefore unexpected.
(after v9.1.1054)
Solution: comment out that part for now. We may need another way to
enable this in the future.
fixes: #16539fixes: #16568fixes: #16649
Signed-off-by: Christian Brabandt <cb@256bit.org>
Tune how automatic colors are derived. It used to use a custom
brightness calculation formula to determine in background color is light
or dark, then then simply interpolate the background color to either
white or black to drive the fill and tab colors. There were a couple
issues:
- Really dark background color would end up interpolating more than a
moderately dark color, leading to the fill color being desaturated and
also perceptually far from background color leading to a
high-constrast look. Ideally we want to have a fixed offset in terms
of perceptual difference between fill and background color.
- The brightness calculation was wrong and flipped the green and blue
coefficients. Also, calculating perceptual brightness in sRGB gamma
space is inherently wrong as the components are not linear.
- Blending colors in sRGB space are also not ideal because we are
blending in gamma space (not linear), and also perceptually each
component will contribute differently.
To fix this, use CIE LAB colors and just change the L* component of the
colors in fixed offsets to calculate a new color that's a
brighter/darker version fo the previous one. This is not completely
accurate but gives a more stable result over a large range of input
colors. The new fill / tab colors are a little more saturated as a
result which subjectively may or may not be more pleasant but with
automatic colors it won't be perfect, and the user who cares would
likely use Vim colorscheme mode instead.
The "Ukrainian enhanced keymap" allows you to type Ukrainian in Vim
using jcuken Windows layout.
Original file is made by Ivan Korneliuk and can be found at
https://github.com/vansha/ukrainian-enhanced.vim. It is being added here
with the permission of the author.
There is another ukrainian layout already in Vim, namely the
keymap\ukrainian-jcuken.vim script by Anatoli Sakhnik. But this one
differs in way it maps numeric keys. It uses values usual for Windows
users.
closes: #16628
Signed-off-by: Vladyslav Rehan <rehanvladyslav@gmail.com>
Signed-off-by: Ivan Korneliuk <vansha@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
When using Vim colorscheme mode, fix the fill foreground colors (used
for add tab and scroll buttons) to use the colorscheme's TabLineFill's
guifg colors. Previously they were automatically calculated based on the
other foreground colors which worked for automatic colors but not when
we are using a colorscheme where it may not match. Just use the one
specified in color scheme. Colorschemes like everforest and koehler
should have visible buttons now.
Also, fix the previous broken logic for parsing the colorscheme colors.
It was not accounting for transparent colors where missing colors or
cleared highlight groups should fall through to default bg/fg colors
(e.g. delek and catppuccin do this for TabLineSel). It also wasn't
respecting the `gui=reverse` flag (which means bg/fg colors should be
flipped) that some colorschemes (e.g. Solarized) uses.
Also, include a fix to builtin colorscheme 'retrobox' where the
TabLineFill group isn't set correctly. This is fixed upstream but
including it here to save some round trip time. See
vim/colorschemes#273.
Problem: tests: Test_terminal_builtin_without_gui waits 2 seconds
Solution: add --not-a-term to remove the annoying 2s delay in error
message when Vim detects that stdio are not from a terminal
(Yee Cheng Chin)
closes: #16635
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Inconsistencies in get_next_or_prev_match() (after 9.1.1109).
Solution: Change "file" to "entry" or "match" in comments. Use the same
order of branches for PAGEUP and PAGEDOWN (zeertzjq).
closes: #16633
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
#1554 added support for `getcellpixels()`, but it has a quirk in MacVim
in that it has a slight delay due to MacVim's asynchronous nature. Make
sure the documentation reflects that to avoid surprises.
Don't use `gui.char_width` / `char_height` unlike the other GVim
implementations. Those are used for deriving screen pixel sizes and
MacVim has been hard-coding them to 1 for simplicity since the actual
GUI functionality is handled out of the Vim process anyway. Changing
those values would require some refactoring. Instead, just use a new
variable to store them.
Note that there is a delay with this method, as we only update Vim's
knowledge of cell size after MacVim has received the font change
message. This means if a user wants to immediately query getcellpixels()
in vimrc or after changing guifont this will not work. This is a
deliberate design choice to avoid having to add synchronous state query
APIs to MacVim, but it's possible to change it in the future. The
handling of this message did get placed in `processInput:` which means
it will be picked up whenever we sleep or process messages in Vim,
instead of only when waiting for keys (where most of other MacVim
messages are handled in `processInputQueue`).
Related: vim/vim#16004