Commit Graph

30903 Commits

Author SHA1 Message Date
Yee Cheng Chin
2ed23bbe98 Merge pull request #1527 from ychin/ci-dont-warn-on-cached-package
ci: Minor fix so that if gettext/libsodium is cached, don't warn
2025-01-19 12:11:32 +09:00
Yee Cheng Chin
7fa7edd405 ci: Minor fix so that if gettext/libsodium is cached, don't warn
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.
2025-01-18 18:18:35 -08:00
Yee Cheng Chin
fd1c3fc996 Merge pull request #1525 from ychin/fullscreen-restore-window-size
Fix full screen window restore / multi-screen / misc issues
2025-01-18 15:40:26 +09:00
Yee Cheng Chin
7787583217 Fix full screen window restore / multi-screen / misc issues
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.
2025-01-17 21:48:02 -08:00
Yee Cheng Chin
954e990db2 Merge remote-tracking branch 'vim/master' 2025-01-09 13:47:48 -08:00
Yee Cheng Chin
ebea31e454 patch 9.1.1000: tests: ruby tests fail with Ruby 3.4
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>
2025-01-09 22:23:29 +01:00
Yee Cheng Chin
2051af1642 patch 9.1.0999: Vim9: leaking finished exception
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>
2025-01-09 22:14:34 +01:00
Wu, Zhenyu
df4a7d7617 runtime(tiasm): use correct syntax name tiasm in syntax script
closes: #16416

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-09 22:09:16 +01:00
Yee Cheng Chin
dabc77372c Merge pull request #1524 from ychin/fix-macvim-website-url-to-new-loc
Fix menu item "MacVim Website" to go to correct URL
2025-01-10 04:27:10 +09:00
Yee Cheng Chin
4edc89f2b2 Fix menu item "MacVim Website" to go to correct URL
We are no longer using the default GitHub Pages URL and have a proper
domain, so use that.
2025-01-09 09:49:52 -08:00
Yee Cheng Chin
598b1421ae Merge pull request #1523 from ychin/tests-refactor-add-fullscreen-delayed
Refactor MacVim tests and add startup delayed full screen tests
2025-01-10 01:15:10 +09:00
Yee Cheng Chin
e33658a843 Refactor MacVim tests and add startup delayed full screen tests
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.
2025-01-09 02:29:47 -08:00
Wu, Zhenyu
4f73c07abf patch 9.1.0998: filetype: TI assembly files are not recognized
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>
2025-01-08 20:26:38 +01:00
John Marriott
a21240b97d patch 9.1.0997: too many strlen() calls in drawscreen.c
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>
2025-01-08 20:10:59 +01:00
Jan-Arvid Harrach
8ab1819df6 runtime(xf86conf): add section name OutputClass to syntax script
References:
https://man.archlinux.org/man/xorg.conf.5#DESCRIPTION

closes: #16397

Signed-off-by: Jan-Arvid Harrach <jharrach@tutanota.com>
2025-01-08 20:05:05 +01:00
glepnir
e890887b80 patch 9.1.0996: ComplMatchIns may highlight wrong text
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>
2025-01-08 18:30:45 +01:00
Doug Kearns
1718e7d07e runtime(vim): Update base-syntax, improve ex-bang matching
Always match ex-bang explicitly rather than incidentally as the ! operator.

fixes: #16221
closes: #16410

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-08 18:20:47 +01:00
Christian Brabandt
1f045f324d runtime(doc): clarify buffer deletion on popup_close()
Reported-by: Lifepillar <lifepillar@lifepillar.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-08 14:09:02 +01:00
Philip H.
e0424b3348 CI: drop setup of snd-dummy module
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>
2025-01-07 20:43:29 +01:00
mtvare6
616219f684 patch 9.1.0995: filetype: shaderslang files are not detected
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>
2025-01-07 20:31:27 +01:00
Yegappan Lakshmanan
0072ceedc6 patch 9.1.0994: Vim9: not able to use comment after opening curly brace
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: #16363
closes: #16405

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-07 20:22:32 +01:00
Yee Cheng Chin
c93f9c0cb6 Merge pull request #1521 from ychin/fullscreen-tests-fuopt-fixes
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
2025-01-07 13:51:26 +09:00
Yee Cheng Chin
73de6ef1b6 Merge pull request #1520 from ilyagr/patch-1
README: link to build instructions, slight polish to Markdown
2025-01-07 13:31:46 +09:00
Yee Cheng Chin
762a8c8f62 Fix non-native full screen misc background color and transparency issues
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.
2025-01-06 19:27:21 -08:00
Yee Cheng Chin
879a21923d Fix non-native full screen bad interaction with window delegate
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.
2025-01-06 19:26:38 -08:00
Yee Cheng Chin
2b136dbac1 Add tests for full screen code
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.
2025-01-06 19:25:28 -08:00
Yee Cheng Chin
ea84370fcf Merge pull request #1522 from ychin/ci-upload-failed-macvim-tests
ci: Upload failed MacVim tests artifacts, misc improvements
2025-01-07 12:24:30 +09:00
Yee Cheng Chin
5b30e663ef ci: Upload failed MacVim tests artifacts, misc improvements
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).
2025-01-06 18:30:37 -08:00
Luuk van Baal
c97e869535 patch 9.1.0993: New 'cmdheight' behavior may be surprising
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>
2025-01-06 18:58:21 +01:00
Christian Brabandt
3159b6494e runtime(sh): fix typo in Last Change header
related: #16394

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-06 18:50:15 +01:00
Yegappan Lakshmanan
2050dcc20f patch 9.1.0992: Vim9: double-free after v9.1.0988
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: #16386
closes: #16388

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-06 18:34:49 +01:00
zeertzjq
6655bef330 patch 9.1.0991: v:stacktrace has wrong type in Vim9 script
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>
2025-01-06 18:32:13 +01:00
Jon Parise
cf1f55548d runtime(sh): add PS0 to bashSpecialVariables in syntax script
PS0 is also a special prompt variable. (It is expanded and displayed
after it reads a command but before executing it.)

References:
https://www.gnu.org/software/bash/manual/html_node/Interactive-Shell-Behavior.html

closes: #16394

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-06 18:27:38 +01:00
Doug Kearns
7ceaa8f3dd runtime(vim): Remove trailing comma from match_words
fixes: #16377 (`filetype plugin indent on` breaks matchit).
closes: #16389

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-06 18:12:11 +01:00
Ilya Grigoriev
959f171a36 README: link to build instructions, slight polish to Markdown
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.
2025-01-05 22:56:35 -08:00
Christian Brabandt
202ebc6ced runtime(zsh): sync syntax script with upstream repo
fixes: #16371

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-05 16:36:40 +01:00
Doug Kearns
8a27d97848 runtime(doc): Capitalise the mnemonic "Zero" for the 'z' flag of search()
closes: #16384

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-05 15:56:57 +01:00
Luuk van Baal
e15cbc1af4 patch 9.1.0990: Inconsistent behavior when changing cmdheight
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>
2025-01-04 17:18:08 +01:00
Doug Kearns
dbe39edb29 patch 9.1.0989: Vim9: Whitespace after the final enum value causes a syntax error
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>
2025-01-04 17:12:24 +01:00
Aliaksei Budavei
cd96075cde runtime(java): Quietly opt out for unsupported markdown.vim versions
fixes #16349
closes: #16369

Signed-off-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-03 17:38:14 +01:00
h-east
6139766e82 runtime(vim): fix failing vim syntax test
after v9.1.0985

related: #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>
2025-01-03 17:32:54 +01:00
Yegappan Lakshmanan
b04af4cc96 patch 9.1.0988: Vim9: no error when using uninitialized var in new()
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: #14411
fixes: #16344
closes: #16374

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-03 10:50:08 +01:00
h-east
27f2e473e1 runtime(doc): update index.txt
related: #16357
closes: #16372

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-03 10:45:15 +01:00
Zoe Roux
a407573f30 patch 9.1.0987: filetype: cake files are not recognized
Problem:  filetype: cake files are not recognized
Solution: detect '*.cake' files as cs filetype
          (Zoe Roux)

References:
https://cakebuild.net/

closes: #16367

Signed-off-by: Zoe Roux <zoe.roux@zoriya.dev>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-03 10:40:31 +01:00
Gregory Anders
58c44e8833 patch 9.1.0986: filetype: 'jj' filetype is a bit imprecise
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>
2025-01-03 10:35:35 +01:00
Gregory Anders
bde76da4d0 runtime(jj): Support diffs in jj syntax
related: #16364

Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-03 10:34:24 +01:00
Doug Kearns
fc61cfd60e runtime(vim): Update matchit pattern, no Vim9 short names
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>
2025-01-03 10:28:09 +01:00
h-east
aa979c763d patch 9.1.0985: Vim9: some ex commands can be shortened
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>
2025-01-03 10:19:45 +01:00
ichizok
663d18d610 patch 9.1.0984: exception handling can be improved
Problem:  exception handling can be improved
Solution: add v:stacktrace and getstacktrace()

closes: #16360

Co-authored-by: Naruhiko Nishino <naru123456789@gmail.com>
Signed-off-by: ichizok <gclient.gaap@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-02 18:06:00 +01:00
h-east
fd771613b3 runtime(doc): update doc for :horizontal
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>
2025-01-02 17:34:55 +01:00