Commit Graph

29956 Commits

Author SHA1 Message Date
9b5ee7df4e NVIM 0.10.3
Christmas edition. This is a maintenance release, focusing on fixes.

FEATURES
--------------------------------------------------------------------------------
- 085f1cc99d main: expand file ~\ or ~/ prefix on Windows

FIXES
--------------------------------------------------------------------------------
- f8ee92feec deps build for ARM64 MSVC
- 163a532cfa api: make `nvim_set_hl()` respect all `cterm` attributes (#31390)
- 6a63034b51 completion: avoid deleting text when completion leader changes #31448
- c257fe5582 coverity/510275: linematch out of bounds access (#30687)
- 7ca0408a1f defaults: don't replace keycodes in Visual search mappings (#31460)
- 71faa2be88 events: don't expand `args.file` for Lua callback (#31473)
- e80e8a0980 extmark: builtin completion can still affect nearby extmarks #31387
- 7abc58349e filetype: make filetype detection work with :doautocmd (#31470)
- 98ec48eefb inccommand: ensure cursor is where it belongs
- 650dcbbafe inspect: always show priority
- b5b84b806a inspect: show priority for treesitter highlights
- bf66871113 lsp: cancel pending requests before refreshing (#31500)
- 308e9719cf lsp: retrigger diagnostics request on server cancellation (#31345) (#31427)
- 84bbbd9fbe lsp: str_byteindex_enc bounds checking #30747
- 01fe4fc589 marks: skip right_gravity marks when deleting text
- 57b0fecd47 startup: report --startuptime error to stderr (#31131)
- 3c0e1a89d9 treesitter: show proper node name error messages
- bbefbc995e tui: avoid flushing buffer halfway an OSC 2 sequence (#30793)
- 424a452401 uri: uri_encode encodes brackets incorrectly for RFC2732 #31284
- 1a030f6e04 vim.system: invalid MAX_TIMEOUT for 32-bit systems #31638
- ee7885aa21 9.1.0759: screenpos() may return invalid position (#30681)

REFACTOR
--------------------------------------------------------------------------------
- b286ba419a fix incorrect use of enum (#30924)
- fb5a0e28db sort various Lua tables in src/ alphabetically (#30978)

DOCUMENTATION
--------------------------------------------------------------------------------
- 9455686b6f misc (#29410)
- 5480c0bd75 lua: "vim.bo" is always equivalent to :setlocal (#30733)
- 27fca9c7d2 lua: clarify when on_key "typed" will be empty (#30774)
v0.10.3
2024-12-21 18:15:18 +01:00
1a030f6e04 fix(vim.system): invalid MAX_TIMEOUT for 32-bit systems #31638
The maximum signed value on 32-bit systems is 2 ^ 31 - 1. When using 2 ^ 31 for
the default timeout, the value would overflow on such systems resulting in
a negative value, which caused a stack trace when calling wait() without
a timeout.

(cherry picked from commit 4e130c1ee4)
2024-12-20 14:06:53 +00:00
bf66871113 fix(lsp): cancel pending requests before refreshing (#31500)
Problem:
Diagnostics and inlay hints can be expensive to calculate, and we
shouldn't stack them as this can cause noticeable lag.

Solution:
Check for duplicate inflight requests and cancel them before issuing a new one.
This ensures that only the latest request is processed, improving
performance and preventing potential conflicts.
2024-12-16 03:17:40 -08:00
424a452401 fix(uri): uri_encode encodes brackets incorrectly for RFC2732 #31284
**Problem:**
The brackets in the RFC2732 regular expression are currently unescaped,
causing them to be misinterpreted as special characters denoting
character groups rather than as literal characters.

**Solution:**
Escape the brackets.
Fix #31270

(cherry picked from commit 442d338cb5)
2024-12-11 14:14:33 +00:00
01fe4fc589 fix(marks): skip right_gravity marks when deleting text
Problem:  Marks that are properly restored by the splice associated with
          an undo edit, are unnecessarily pushed to the undo header. This
          results in incorrect mark tracking in the "copy_only"
          save/restore completion path.
Solution: Avoid pushing left gravity marks at the beginning of the range,
          and right gravity marks at the end of the range to the undo
          header.
(cherry picked from commit c4f76299f0)
2024-12-10 12:50:54 +00:00
7abc58349e fix(filetype): make filetype detection work with :doautocmd (#31470)
(cherry picked from commit 1077843b9b)
2024-12-10 03:17:12 +00:00
8fbe3e3941 Merge pull request #31532 from zeertzjq/backport
fix(events): don't expand `args.file` for Lua callback (#31473)
2024-12-10 10:51:40 +08:00
71faa2be88 fix(events): don't expand args.file for Lua callback (#31473)
Problem:  In an autocommand Lua callback whether `args.file` is expanded
          depends on whether `expand('<afile>')` has been called.
Solution: Always use the unexpanded file name for `args.file`.

Related to #31306 and vim/vim#16106. This doesn't provide `sfname`, but
at least makes `args.file` have a consistent value.
2024-12-10 10:19:01 +08:00
650dcbbafe fix(inspect): always show priority
Problem: It is not obvious if a treesitter highlight priority shown in
`:Inspect` is higher or lower than the default.

Solution: Also print default priority (`vim.hl.priorities.treesitter`).
Add padding for better readability.

(cherry picked from commit b52ffd0a59)
2024-12-07 16:51:17 +00:00
6a63034b51 fix(completion): avoid deleting text when completion leader changes #31448
Problem:  When completion leader changes, text that might be reinserted
          immediately after is deleted. This unnecessarily affects
          extmarks. #31387 restored the original extmarks but that
          prevents end_right_gravity marks from growing.
Solution: Avoid deleting leader text that will be reinserted.
(cherry picked from commit e788d1a3a9)
2024-12-07 14:54:33 +00:00
b5b84b806a fix(inspect): show priority for treesitter highlights
Problem: `:Inspect` does not show priority for treesitter highlights,
leading to confusion why sometimes earlier highlights override later
highlights.

Solution: Also print priority metadata if set.
(cherry picked from commit 9c278af7cc)
2024-12-07 09:51:46 +00:00
950048b206 Merge pull request #31461 from zeertzjq/backport
fix(defaults): don't replace keycodes in Visual search mappings (#31460)
2024-12-05 19:52:55 +08:00
7ca0408a1f fix(defaults): don't replace keycodes in Visual search mappings (#31460)
Also remove "silent" to be more consistent with Normal mode search.
2024-12-05 19:33:33 +08:00
78a36cdd55 Merge pull request #31452 from jamessan/backport-31358
Backport release build test fixes
2024-12-04 19:51:39 -07:00
694c3992ea test(marktree): expose test functions in release builds
In order to run the marktree unit test in release mode, the test functions need to be available even when NDEBUG is defined.

Keep the body of marktree_check a nop during release builds, which limits the usefulness of the testing, but at least lets the tests run.
2024-12-04 21:30:53 -05:00
9695650c0c ci: run tests directly rather than via the Makefile
Since the Makefile is not used to build, running the tests via the Makefile causes cmake to reconfigure and revert the release build back to debug.
2024-12-04 21:30:52 -05:00
7781111fef test(main_spec): make "nvim -v" test agnostic to build type
In release builds, the Compilation: line is omitted so the build is reproducible. Since the "fall-back for $VIM" line is always present, check for that instead.
2024-12-04 21:30:52 -05:00
4007c42b77 test(version_spec): expect vim.NIL, not nil, for "build" if not in a git clone 2024-12-04 21:30:52 -05:00
584b811aee test(main_spec): use CMakePresets.json instead of .git for root marker 2024-12-04 21:30:51 -05:00
a930b2666e ci(test): remove the .git directory for Linux
Tests should not rely on being run inside a git clone, so the Linux
builds cover this use case. The macOS builds will continue running with
the .git directory so there's still unix-ish coverage within a git
clone.
2024-12-04 21:30:51 -05:00
c36c4ddae2 ci: run one set of tests with a release build
This ensures that no tests fail due to differences between release and debug builds.

The release build-type check is now unnecessary, too, so remove it.
2024-12-04 21:30:43 -05:00
308e9719cf fix(lsp): retrigger diagnostics request on server cancellation (#31345) (#31427)
Co-authored-by: Jesse <github@jessebakker.com>
(cherry picked from commit 29c72cdf4a)
2024-12-02 12:13:23 -06:00
e80e8a0980 fix(extmark): builtin completion can still affect nearby extmarks #31387
Problem:
Built-in completion can still affect nearby extmarks. #31384

Solution:
Restore extmarks when completion leader changes.

(cherry picked from commit c7ec010ade)
2024-12-02 15:28:38 +00:00
163a532cfa fix(api): make nvim_set_hl() respect all cterm attributes (#31390)
(cherry picked from commit 8de1dc6923)
2024-12-02 00:51:14 +00:00
1a12dea191 test(filetype): symlink detection works after expand('<afile>') (#31307)
Also add a test for #31306, which currently fails.

(cherry picked from commit c697c49a76)
2024-11-22 11:44:04 +00:00
6f2786433d test(autocmd/termxx_spec): fix TextChangedT test flakiness (#31296)
Problem:  The E937 error appears for too short in TextChangedT test.
Solution: Only feed an Enter key after seeing the error.
(cherry picked from commit 3597633075)
2024-11-22 00:32:36 +00:00
085f1cc99d feat(main): expand file ~\ or ~/ prefix on Windows
In command_line_scan() for MSWIN, expand "~\" or "~/" prefixed paths to
the USERPROFILE environment variable for the user's profile directory.

Rename the static os_homedir() to os_uv_homedir() to emphasize that it
is a wrapper around a libuv function.

Add the function os_get_homedir() to os/env.c to return the cached
homedir value as a const. Must be called after homedir is initialized or
it fails.

The difference between this function and the static os_uv_homedir() is
that the latter gets the homedir from libuv and is used to initialize
homedir in init_homedir(), while os_get_homedir() just returns homedir
as a const if it's initialized and is public.

Use the os_get_homedir() accessor for ~/ expansion on Windows to make
the code more concise.

Add a Windows section to main_spec.lua with tests for expanding ~/ and
~\ prefixes for files passed in on the command-line.

Fix #23901

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-11-19 07:26:37 +08:00
3c0e1a89d9 fix(treesitter): show proper node name error messages
**Problem:** Currently node names with non-alphanumeric, non
underscore/hyphen characters (only possible with anonymous nodes) are
not given a proper error message. See tree-sitter issue 3892 for more
details.

**Solution:** Apply a different scanning logic to anonymous nodes to
correctly identify the entire node name (i.e., up until the final double
quote)

(cherry picked from commit 36990f324d)
2024-11-13 13:03:00 +00:00
57b0fecd47 fix(startup): report --startuptime error to stderr (#31131)
Problem:  Crash when initializing for --startuptime errors.
Solution: Report the error to stderr, as neither logging nor messages
          have been initialized yet.
(cherry picked from commit 17e00d0cc6)
2024-11-13 05:47:28 +00:00
f8ee92feec fix: deps build for ARM64 MSVC
Problem:

Neovim will not build for ARM64 using MSVC due to misconfigured
gettext dependency build settings.

Solution:

Fix the dependency build settings for gettext when building with MSVC.

(cherry picked from commit 7737f89206)
2024-11-09 15:48:00 +00:00
98ec48eefb fix(inccommand): ensure cursor is where it belongs
Problem:  Inccommand preview callback may flush inaccurate cmdline cursor position.
Solution: Ensure cursor is where it belongs when doing command preview.
(cherry picked from commit 59e130b6ca)
2024-11-09 15:26:32 +00:00
34a976ec2b ci: downgrade to clang 19
Clang 20 is still in development at the time of this commit and is
unsuitable for CI.

(cherry picked from commit 7d8dd8234a)
2024-11-09 15:09:52 +00:00
6a07b199ff vim-patch:9.1.0003: Cannot build against Ruby 33 dynamically (#30683)
Problem:  Cannot build against Ruby 33 dynamically
Solution: Ruby 33 removed transient heap, so do not use
          rb_ary_transient anymore, NoMethodError format changed,
          so update test for expected error message
          (Isao Sato)

- ruby-3.3 removed transient heap for ruby/dyn

when +ruby/dyn with ruby-3.3 do command :ruby, E448 occur.
ruby-3.3 has no transient heap anymore, so disable rb_ary_transient etc.

$ LC_ALL=C VIMRUNTIME=runtime ./src/vim -u NONE -c 'ruby puts RUBY_VERSION'
"=> Error detected while processing command line:
"=> E448: Could not load library function rb_ary_detransient
"=> E266: Sorry, this command is disabled, the Ruby library could not be
    loaded.

- ruby-3.3 changed NoMethodError format:

$ rvm 3.2.2, 3.3.0-rc1 do ruby -e 'begin; nil.name; rescue => e; puts "%s : %s"%[RUBY_VERSION, e.message]; end '
=> 3.2.2 : undefined method `name' for nil:NilClass
=> 3.3.0 : undefined method `name' for nil

so loose pattern in Test_ruby_Vim_buffer_get()

closes: vim/vim#13741

443657b32b

Co-authored-by: Isao Sato <svardew@gmail.com>
2024-11-09 13:11:47 +01:00
6550227110 ci: bump Intel macOS runners to 13
Problem: macos-12 GH runners are deprecated and will be removed soon.

Solution: use macos-13 runners instead.
2024-11-09 13:11:47 +01:00
b7f025e45b ci: adjust reviewers 2024-11-09 13:11:47 +01:00
6c12cfe18c ci: work around flaky python tests (#31063)
It's the same workaround as 88ed9ffcd1,
which was later removed in f707ce76ac
after it turned out to be stable after a while.
2024-11-09 13:11:47 +01:00
7774ca9107 ci: bump macos runner version to macos-15 2024-11-09 13:11:47 +01:00
348a939168 tests: skip watch.watchdirs test on macos 14 CI
Problem:
Strange failure only in macos 14 CI

    FAILED   test/functional/lua/watch_spec.lua @ 82: vim._watch watchdirs() detects file changes
    test/functional/lua/watch_spec.lua:149: Expected objects to be the same.
    Passed in:
    (table: 0x0116023758) {
     *[1] = {
        [change_type] = 3
       *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/nvim_KFMvPbXk9a' }
      [2] = {
        [change_type] = 3
        [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } }
    Expected:
    (table: 0x010d9d6548) {
     *[1] = {
        [change_type] = 1
       *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' }
      [2] = {
        [change_type] = 3
        [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } }

    stack traceback:
            test/functional/lua/watch_spec.lua:149: in function <test/functional/lua/watch_spec.lua:82>

Solution:
Skip test for that exact version.
2024-11-09 13:11:47 +01:00
9455686b6f docs: misc (#29410)
Co-authored-by: Michael Härtl <haertl.mike@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-11-09 13:11:47 +01:00
1a4e78832f ci: bump ubuntu runner version to ubuntu-24.04
Also bump clang to version 20.
2024-11-09 13:11:47 +01:00
fb5a0e28db refactor: sort various Lua tables in src/ alphabetically (#30978)
refactor: sort various Lua tables in src/ alphabetically (#30977)

(cherry picked from commit 42fa3d080e)

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-10-29 08:14:08 +08:00
b286ba419a refactor: fix incorrect use of enum (#30924)
refactor: fix incorrect use of enum (#30631)

(cherry picked from commit 184d5e7543)

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-10-24 12:43:15 +08:00
94f44122ad test(012_directory_spec): fix flakiness on Windows (#30921)
test(012_directory_spec): fix flakiness on Windows (#30920)

Problem:  012_directory_spec is flaky on Windows.
Solution: Use :%bwipe! instead :qall!.
(cherry picked from commit fffcb88ad6)

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-10-24 11:57:40 +08:00
0b0385ea6a test(rpc): retry flaky 'vim.rpcrequest and vim.rpcnotify' test (#30922)
Problem: 'vim.rpcrequest and vim.rpcnotify' is flaky on Windows.

Solution: retry it.
(cherry picked from commit 6fd13eedda)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2024-10-24 11:45:24 +08:00
84bbbd9fbe fix(lsp): str_byteindex_enc bounds checking #30747
Problem:
Previously the index was only checked against the UTF8 length. This
could cause unexpected behaviours for strings containing multibyte chars

Solution:
Check indicies correctly against their max value before returning the
fallback length

(cherry picked from commit 80e37aa533)
2024-10-16 17:25:37 +00:00
bbefbc995e fix(tui): avoid flushing buffer halfway an OSC 2 sequence (#30793)
Problem:  Setting title while TUI buffer is almost full may cause the
          end of a flush to be treated as a part of an OSC 2 or OSC 0
          sequence, leading to problems like invisible cursor.
Solution: Make the whole sequence to set title a unibi_ext string.
(cherry picked from commit 4846bf05dc)
2024-10-15 00:18:12 +00:00
97aaea3478 test(tui_spec): use Unicode in cursor_address test (#30807)
Now that #16425 is fixed, use Unicode again to reduce screen height.
Unfortunately composing chars still can't be used, as it turns out that
composing chars may be missing when sent separately from the base char
at the last char a screen line.

(cherry picked from commit 1189c5ce59)
2024-10-14 08:20:44 +00:00
1a02f1835f test(autocmd/termxx_spec): properly setup TextChangedT tests (#30788) 2024-10-13 11:29:29 +08:00
2d1a13bdf5 vim-patch:9.1.0776: test_strftime may fail because of missing TZ data (#30780)
Problem:  test_strftime may fail because of missing TZ data
Solution: Use GMT offsets to validate timezone differences (James McCoy)

Some systems only provide timezones that follow the geographical region
naming (e.g. America/New_York) by default and require an additional
install for other names (like EST).

The GMT+<offset> format must always be honored, so use that to generate
distinct data for the test.

closes: vim/vim#15848

ea997edc7a

Co-authored-by: James McCoy <jamessan@jamessan.com>
(cherry picked from commit b0ddc1783a)
2024-10-12 22:54:59 +00:00
27fca9c7d2 docs(lua): clarify when on_key "typed" will be empty (#30774)
(cherry picked from commit 45f8f957c0)
2024-10-12 04:42:41 +00:00