Previously when we try to set up a cached package, Homebrew generates an
annoying "already installed, it's just not linked" warning which is
distracting when parsing CI logs. Just make sure to run `brew install`
if we don't have the package cached.
Note that when a package is not cached and we have to rebuild it,
Homebrew will still warn needlessly because we have
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK set. This is mostly ok because
most of the time our packages should be cached in CI.
Native full-screen:
Fix restoring window when we don't have smooth resize setting set. The
NSWindow has a contentResizeIncrement set and macOS seems to have a
bug/quirk where it would ignore it when entering full screen, but on
exit, it will use it to determine the final window size. This means it
would restore the window to a slightly different and wrong size. From
testing, seems like Apple's own Terminal just works around that by
always resizing the window after existing full screen and other apps
just have this subtle bug. For MacVim, we just fix it by temporarily
removing the contentResizeIncrement while exiting full screen, which is
a small hack but it works.
Non-native full screen:
Fix restoring window when we have smooth resize setting set. Previously
we remember the number of lines/columns and manually resize to that on
exit, but it could result in the restored window size being wrong. Just
do the more sensible thing and simply keep the old window size and
rescale the Vim view inside it. It simplifies the code and make
everything works more intuitively, and it makes sure the old window size
is respected. Long term goal is to keep MMFullScreenWindow as simple as
possible the window controller whould be the one doing the more
complicated integration work.
Also fix manually dragging a non-native full screen window across
multiple screen (e.g in Mission Control) to work properly, and make sure
the restored window is in the new screen.
Other improvements:
- Make sure the non-native full screen window has "movable" set to NO,
and configure the window so it cannot go full screen. These make sure
macOS would properly gray out the Window menu item for window
tiling/full screen/etc. Previously the user could use those
accidentally which leads to bad results.
- Remove the previous code that tried to make sure we restore the window
the current Space (i.e. virtual desktop). macOS has no explicit
control for Mission Control Spaces and the old method does not work
and relies on a hacky way of configuring the collection method. This
is a niche situation anyway. See code comments for details.
Tests
- In order to get the tests for this to pass in CI, I had to add a
somewhat hacky solution to manually inject a user click to pretend we
have clicked on the window to resize it. There is an obscure macOS
quirk/bug where it seems to restore a full screen window to an old
location that the user has manually interacted with but this bug only
seems to happen in a VM and not a real machine. The workaround allows
our tests to pass consistently regardless of where it is run.
Problem: tests: ruby tests fail with Ruby 3.4
Solution: adjust expected output for Ruby 3.4
(Yee Cheng Chin)
Vim's Ruby tests relied on explicit matching of output texts which are
fragile in design. Ruby 3.4 has changed the output slightly (using
'name' instead of `name', and also using more spaces in dictionary
printouts). Modify the Vim tests to be less fragile to such changes.
closes: #16411
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: leaking finished exception
(after v9.1.0984)
Solution: use finish_exception to clean up caught exceptions
(Yee Cheng Chin)
In Vimscript, v:exception/throwpoint/stacktrace are supposed to reflect
the currently caught exception, and be popped after the exception is
finished (via endtry, finally, or a thrown exception inside catch).
Vim9script does not handle this properly, and leaks them instead. This
is clearly visible when launching GVim with menu enabled. A caught
exception inside the s:BMShow() in menu.vim would show up when querying
`v:stacktrace` even though the exception was already caught and handled.
To fix this, just use the same functionality as Vimscript by calling
`finish_exception` to properly restore the states. Note that this
assumes `current_exception` is always the same as `caught_stack` which
believe should be the case.
Added tests for this. Also fix up test_stacktrace to properly test the
stack restore behavior where we have nested exceptions in catch blocks
and to also test the vim9script functionality properly.
- Also, remove its dependency on explicitly checking a line number in
runtest.vim which is a very fragile way to write tests as any minor
change in runtest.vim (shared among all tests) would require changing
test_stacktrace.vim. We don't actually need such granularity in the
test.
closes: #16413
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Add test suite utility functions to set/restore defaults, adding/tearing
down a new Vim window, making temp files, wait for full screen
transition. This helps simplify per-test code and prevent mistakes.
Add new tests for delayed full screen on startup. This happens when a
vimrc/gvimrc sets 'fullscreen' on startup and MacVim has to delay
entering full screen until the window has been presented. This
incidentally regression tests a bug (fixed in #1521) where simply having
'set fuopt= fullscreen' in a gvimrc would cause MacVim to crash on
startup due to bad interaction with window resize messages.
Problem: filetype: TI assembly files are not recognized
Solution: inspect '*.sa' and assembly files and detect TI assembly
files, include filetype plugin and syntax script for TI
assembly files (Wu, Zhenyu)
closes: #15827
Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls in drawscreen.c
Solution: refactor drawscreen.c and remove calls to strlen(),
make get_keymap_str() (in screen.c) return string length
instead of TRUE/FALSE (John Marriott).
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: ComplMatchIns may highlight wrong text
Solution: don't highlight in case of fuzzy match,
skip-highlight when not inserting anything
(glepnir)
closes: #16404
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Always match ex-bang explicitly rather than incidentally as the ! operator.
fixes: #16221closes: #16410
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Apparently even when loading the snd-dummy kernel module, the
CI tests for the sounds feature in test_sound.vim are already skipped.
So let's just remove all of this (even so we may loose a bit of coverage
information here).
closes: #16391
Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: shaderslang files are not detected
Solution: detect '*.slang' files as shaderslang filetype,
include a filetype and syntax script (mtvare6)
Reference:
https://shader-slang.com/closes: #16387
Signed-off-by: mtvare6 <mtvare6@proton.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: not able to use comment after opening curly brace
(lifepillar)
Solution: allow to use comments after curly braces of an inner-block,
modify the logic to search for comment in a line, update Vim9
tests to use specific class type instead of any
(Yegappan Lakshmanan)
fixes: #16363closes: #16405
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Contains the following:
1. Fix non-native full screen misc background color and transparency issues.
2. Fix non-native full screen bad interaction with window delegate.
3. Add tests for full screen code
Fixed misc bugs:
- Previously, setting a colorscheme while in non-native full screen would
override the background color specified in 'fuoptions' (default is
black). It also wouldn't update the specified color if it's specified to
a highlight group (e.g. `set fuopts=background:Normal`).
- Transparency and background colors and setting colorscheme also didn't
work well togehter. Changing a background color while in fullscreen
would reset transparency back to 0.
Also, 'fuoptions' can now specify background color in 6-digit hex number
now, in addition to the old 8-digit format. Also update docs to
elaborate that when using 8-digit, the alpha component is ignored (since
we use the 'transparency' setting instead).
Add new tests to test 'fuoptions' work.
This issue was detected when adding new tests for non-native full
screen. When setting 'fuoptions' to empty and going full screen, the
code would fail but also crash, due to a number of issues:
1. `enterFullScreen`'s setting of presentationOptions somehow triggers a
window resize on the normal window, which leads to `windowDidResize`
delegate being called. This is a degenerate situation as the window
controller thinks we are already in full screen even though we
haven't finished setting up yet, and in particular `nonFuVimViewSize`
is still 0. This leads to the desired desired frame size being set
incorrectly to 0.
2. `constrainRows:columns:toSize` does not sanity check the results when
we have such degenerate small sizes, and end up calculating a desired
rows to -1, which makes no sense. This leads to various wrong
calculations.
3. MMCoreTextView loops through the grid using a size_t even though
grid.rows is an int. This is a poor code practice in general and
results in a crash as the loop comparison cast the -1 to size_t and
the loop didn't correctly terminate.
Fix 1 (the root cause) by making sure we detact the window delegate
immediately when entering full screen to prevent any stray window
messages from causing issues. Also safeguard `windowDidResize` so it
only handles the full screen path if we have `fullScreenEnabled` set.
For 2 and 3, add the sanity checks and also fix the size_t to use int
when looping.
For some reason this issue only showed up in CI but not in local
testing, probably due to different screen environments.
Basic tests to validate different full screen functionalities. Help
prevents regressions such as #1515 where full screen simply stops
working.
Not an exhaustive test for now. Some functionalities (e.g.
multi-monitor, MacBook notch) are hard to mock up and validate in tests.
Some other functionalities like restoring window size, delayed full
screen on startup (when setting it from gvimrc) will be added later.
Add new step to upload MacVim test results when we have failed tests.
The xcresult folder can be opened in Xcode for inspection to help
understand what went wrong. Also, fix the ordering so failed Vim GUI
test artifacts can be uploaded as well.
When configuring Vim, be explicit to not build with sodium/gettext for
the non-publish builds. This makes sure that even if the CI environment
somehow has them installed by default, we won't use them by mistake.
Those installed packages would be built for a different OS target anyway
and throw out warnings (the ones we bundle with MacVim are custom built
to target the proper OS versions).
Problem: Although patch 9.1.0990 fixed a real problem/inconsistency,
it also introduced new behavior that may break BWC and/or be
unexpected. Before 9.1.0990, window commands could make the
topframe smaller (without changing 'cmdheight'; quirk that is
now fixed), but did not allow extending the topframe beyond
the 'cmdheight' set by the user. After 9.1.0990, the user can
reduce the 'cmdheight' below the value they set explicitly,
through window commands, which may lead to confusion.
(aftere v9.1.0990)
Solution: Store the value explicitly set by the user and clamp the
'cmdheight' when resizing the topframe. This also applies to
dragging laststatus, which in contrast to window commands
_did_ allow reducing the 'cmdheight' to values below the one
set by the user. So with this patch there is still new
behavior, but I think in a way that is less surprising.
While at it, also fix a Coverity warning, introduced in
v9.1.0990 (Luuk van Baal)
closes: #16385
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: double-free after v9.1.0988
(h-east)
Solution: clear typval pointer, before setting the type
(Yegappan Lakshmanan)
Otherwise the contents are still referring to some other value.
fixes: #16386closes: #16388
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: v:stacktrace has wrong type in Vim9 script.
Solution: Change the type to t_list_dict_any. Fix grammar in docs.
(zeertzjq)
closes: #16390
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
I found it difficult to find the instructions for building MacVim from source, but very easy to build it once I found the instructions.
Hopefully, this will help others find these helpful instructions.
Problem: Inconsistent behavior when changing cmdheight by resizing the
topframe through wincmds and dragging laststatus. Changing
cmdheight by resizing the topframe does not trigger OptionSet.
Solution: Consolidate logic for changing the cmdheight, set the option
value to handle side-effects (Luuk van Baal)
closes: #16359
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: Whitespace after the final enum value causes a syntax
error
Solution: Fix parsing to allow whitespace after the final enum value.
(Doug Kearns)
closes: #16383
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: no error when using uninitialized var in new()
(lifepillar, Aliaksei Budavei)
Solution: Give an error if an uninitialized object variable is referenced
in new() (Yegappan Lakshmanan)
fixes: #14411fixes: #16344closes: #16374
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: 'jj' filetype is a bit imprecise
Solution: rename 'jj' filetype to 'jjdescription'
(Gregory Anders)
closes: #16364
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Abbreviated :enum and :interface commands are no longer supported.
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: some ex commands can be shortened
Solution: disallow shortening of :abstract, :interface and :type
(h-east)
closes: #16356
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Revert the documentation for :horizontal from commit
0c3e57b403 because :horizontal cannot be shortened to :ho
closes: #16362
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>