Commit Graph

33133 Commits

Author SHA1 Message Date
cf0f90fe14 feat(async): add vim._async
Problem: no easy built-in way to do async

Solution: add `vim._async`
2025-07-04 15:53:29 +03:00
3694fcec28 vim-patch:8.2.1983: ml_get error when using <Cmd> to open a terminal (#34759)
Problem:    ml_get error when using <Cmd> to open a terminal.
Solution:   If the window changed reset the incsearch state. (closes vim/vim#7289)

f4d61bc559

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-04 07:30:34 +00:00
16001b4d84 vim-patch:0d50d60: runtime(postscr): Correct some standard font names in syntax
closes: vim/vim#17647

0d50d6089d

Co-authored-by: Mike Williams <mrmrdubya@gmail.com>
2025-07-04 08:55:53 +02:00
bb75610d99 vim-patch:9.1.1507: symlinks are resolved on :cd commands (#34758)
Problem:  File paths change from symlink to target path after :cd command
          when editing files through symbolic links
Solution: Add "~" flag to 'cpoptions' to control symlink resolution.
          When not included (default), symlinks are resolved maintaining
          backward compatibility. When included, symlinks are preserved
          providing the improved behavior. (glepnir)

related: neovim/neovim#15695
closes: vim/vim#17628

4ade668fb6
2025-07-04 05:44:39 +00:00
c48dea20f5 vim-patch:9.1.1508: string manipulation can be improved in cmdexpand.c (#34755)
Problem:  String manipulation can be improved in cmdexpand.c
Solution: Refactor cmdexpand.c to remove calls to
          STRLEN()/STRMOVE()/STRCAT() (John Marriott)

This commit does the following:

In function nextwild():
  - slightly refactor the for loop to remove an array access
  - call STRLEN() and store it's result for reuse
  - move some variables closer to where they are used, renaming some on
    the way

In function ExpandOne():
  - move some calculations outside of the for loops
  - factor out calls to STRCAT() (which has an inherent STRLEN() call) in
    the for loop
  - move some variables closer to where they are used

In function expand_files_and_dirs():
  - factor out calls to STRMOVE() (which has an inherent STRLEN() call)

In function get_filetypecmd_arg():
  - move declarations of the string arrays into the blocks where they are
    used

In function get_breakadd_arg():
  - move declaration of the string array into the block where it is
    used

In function globpath():
  - factor out calls to STRLEN() and STRCAT()
  - move some variables closer to where they are used

And finally some minor cosmetic style changes

closes: vim/vim#17639

a494ce1c64

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-07-04 12:12:41 +08:00
5db833b475 Merge pull request #34744 from zeertzjq/test-override
test(old): emulate test_override('char_avail') using FFI
2025-07-04 12:07:15 +08:00
f348c0ebba fix(incsearch): include compsing characters with Ctrl-L
Cherry-picked from Vim patch 8.1.0579.
2025-07-04 11:00:14 +08:00
c925e7b8ba test(old): emulate test_override('char_avail') using FFI
Add a non-static variable for this, otherwise it'll be really hacky.
This avoid having to rewrite many incsearch tests in Lua.
2025-07-04 11:00:14 +08:00
bfffe0d214 test(ui/messages_spec): fix flakiness (#34754) 2025-07-04 10:59:41 +08:00
17ecb2b988 test(editor/defaults_spec): fix flakiness (#34752) 2025-07-04 10:35:15 +08:00
14d8d11671 vim-patch:ba47934: runtime(netrw): remove netrwSettings.vim (#34747)
relevant commits:
- distribution: remove NetrwSettings.vim

closes: vim/vim#17635

ba479348d4
2025-07-03 22:47:34 +00:00
eef62e815d vim-patch:9.1.1506: tests: missing cleanup in Test_search_cmdline_incsearch_highlight() (#34748)
Problem:  tests: missing cleanup test_override('char_avail', 0) in
          Test_search_cmdline_incsearch_highlight().
Solution: Add the missing cleanup (zeertzjq).

closes: vim/vim#17655

29b29c6b30
2025-07-04 06:28:55 +08:00
f01419f3d5 feat(runtime): accept predicates in take and skip (#34657)
Make `vim.iter():take()` and `vim.iter():skip()`
optionally accept predicates to enable takewhile
and skipwhile patterns used in functional
programming.
2025-07-03 08:12:24 -05:00
715c28d67f test(old): emulate test_override('starting') with FFI (#34742)
I was initially trying to port several cmdline tests from Vim involving
test_override('char_avail') without having to rewrite entire tests in
Lua, but haven't figured out a good way achieve that yet. Nevertheless
emulating test_override('starting') is easier.
2025-07-03 19:21:58 +08:00
ac75de0d2a test: add more structure to vim.bo/wo tests 2025-07-03 11:05:08 +01:00
a5e582dab6 test: move lua option/variable tests to a separate file 2025-07-03 11:05:08 +01:00
0a6a73fd25 refactor: option tests 2025-07-03 11:05:08 +01:00
fc1be07d28 vim-patch:9.1.1504: filetype: numbat files are not recognized
Problem:  filetype: numbat files are not recognized
Solution: detect *.nbt files as numbat filetype (0xadk)

References:
- https://github.com/sharkdp/numbat
- https://github.com/sharkdp/numbat/tree/master/numbat/modules

closes: vim/vim#17643

20eb68a8f2

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
0a14ac3261 vim-patch:9.1.1503: filetype: haxe files are not recognized
Problem:  filetype: haxe files are not recognized
Solution: detect *.hx files as haxe filetype (0xadk)

References:
- https://haxe.org/
- https://code.haxe.org/category/beginner/hello-world.html

closes: vim/vim#17644

b46e3aa0fa

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
18cfbf8fb2 vim-patch:9.1.1502: filetype: quickbms files are not recognized
Problem:  filetype: quickbms files are not recognized
Solution: detect *.bms files as quickbms filetype
          (0xadk)

Reference:
- https://aluigi.altervista.org/quickbms.htm

closes: vim/vim#17645

fdcdded4d5

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
da42f99eb4 vim-patch:9.1.1501: filetype: flix files are not recognized
Problem:  filetype: flix files are not recognized
Solution: detect *.flix files as flix filetype
          (0xadk)

References:
- https://flix.dev/
- https://doc.flix.dev/introduction.html

closes: vim/vim#17646

b211916e0a

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
535e292436 vim-patch:5ecee30: runtime(go): add section movement mappings to ftplugin
closes: vim/vim#17641

5ecee30dcd

Co-authored-by: Rob B <github@0x7e.net>
2025-07-03 00:28:39 +02:00
168bf0024e fix(treesitter): ensure TSLuaTree is always immutable
Problem:

The previous fix in #34314 relies on copying the tree in `tree_root` to
ensure the `TSNode`'s tree cannot be mutated. But that causes the
problem where two calls to `tree_root` return nodes from different
copies of a tree, which do not compare as equal. This has broken at
least one plugin.

Solution:

Make all `TSTree`s on the Lua side always immutable, avoiding the need
to copy the tree in `tree_root`, and make the only mutation point,
`tree_edit`, copy the tree instead.
2025-07-02 17:05:17 +01:00
94f44d58fd test(treesitter): test tree:root() is idempotent
Test for regression #34605
2025-07-02 17:05:17 +01:00
4eebc46930 fix(vim.system): env=nil passes env=nil to uv.spawn
731e616a79 made it so passing `{env = nil, clear_env = true }` would
pass `{env = {}}` to `vim.uv.spawn`.

However this is not what `clear_env` is (arguably) supposed to do.
If `env=nil` then that implies the uses wants `vim.uv.spawn()` to use
the default environment. Adding `clear_env = true` simply prevents
`NVIM` (the base environment) from being added.

Fixes #34730
2025-07-02 17:01:29 +01:00
e91224bfaa build: support static build #34728 2025-07-02 07:54:17 -07:00
807bc00dd6 fix(lsp): use vim.notify with action-less showMessage requests (#34720) 2025-07-01 17:13:58 +00:00
38aac21083 fix: type of nvim_echo 2025-07-01 12:57:37 +01:00
f731766474 Merge #34715 vim.version improvements 2025-07-01 04:19:42 -07:00
99873296be test(exrc): lua exrc knows its location #34713
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-07-01 03:51:48 -07:00
66f02ee1fe vim-patch:9.1.1498: completion: 'complete' funcs behave different to 'omnifunc' (#34718)
Problem:  completion: Functions specified in the 'complete' option did
          not have the leader string removed when called with findstart = 0,
          unlike 'omnifunc' behavior
Solution: update behaviour and make behaviour consistent (Girish Palya)

closes: vim/vim#17636

fa16c7ab3f

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-30 23:58:06 +00:00
af6b3d6fec vim-patch:a5b744e: runtime(vim): Update base-syntax, improve :syn-sync line defaults (#34719)
Set minlines and maxlines to 100 and 200 respectively.  Set these after
the script interface syntax files have been loaded to ensure the values
set in those are overridden.

fixes vim/vim#17580
closes: vim/vim#17614

a5b744ef93

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-30 23:29:54 +00:00
773075b2bc feat(vim.version): add vim.version.intersect()
Problem: No way to compute intersection of two version ranges, which is
useful when computing version range that fits inside several reference
ranges.

Solution: Add `vim.version.intersect()`.
2025-06-30 20:59:44 +03:00
649ff924d9 fix(vim.version): improve construction of '<=a.b.c' and '>a.b.c' ranges
Problem: `vim.version.range('<=a.b.c')` is not precise when it comes to
its right hand side. This is due to version ranges using exclusive right
hand side. While `vim.version.range('>a.b.c')` is not precise when it
comes to its left hand side because left hand sides are inclusive.

Solution: For '>=a.b.c' increase `to` from 'a.b.c' to the smallest
reasonable version that is bigger than 'a.b.c'. For '<a.b.c' do the same
for `from`.
More proper solution is an explicit control over inclusivity of version
range sides, but it has more side effects and requires design decisions.
2025-06-30 20:59:12 +03:00
4034476dd3 doc(vim.version): options formatting #34716 2025-06-30 09:55:29 -07:00
d6d1bfd20d fix(term): terminal attr index may exceed TERM_ATTRS_MAX #34318
Problem: Currently terminal highlight attribute buffers are statically allocated
be the size of `TERM_ATTRS_MAX`. This unique case isn't respected in
some places in the ui_compositor. Due to this, when a terminal window
has lines longer them `TERM_ATTRS_MAX`, the compositor will go past the
end of the buffer causing a crash due to out of bounds access.

Solution: Add check to ensure we don't query terminal highlight attrs
past `TERM_ATTRS_MAX` in `win_line()`.

Fixes #30374
2025-06-30 06:22:42 -07:00
aeb8bca12d feat(vim.version): make tostring() return human-readable version range
Problem: `tostring()` applied to version range doesn't return
human-readable text with information about the range.

Solution: Add `__tostring()` method.
2025-06-30 16:08:56 +03:00
561021bacd docs(vim.version): document vim.VersionRange as a dedicated class 2025-06-30 16:08:30 +03:00
ed7ff848a0 fix(prompt): prompt mark not placed after text edits correctly #34671 2025-06-30 03:19:43 -07:00
f7c939fa7a fix(exrc): exrc knows its own location (#34638)
fix(exrc): lua exrc files know their location

Problem:
'exrc' files are inherently bound to their location / workspace and
therefore require to "know" their location on the filesystem. However,
currently using `debug.getinfo(1, 'S')` returns `"<nvim>"`.

Solution:
Include the filepath as chunkname in `loadstring()` and `nlua_exec()`.
2025-06-29 10:19:10 -05:00
2f95abddfa refactor(health): use vim.system():wait() #34702
Problem:
- The ripgrep probe still used the legacy `vim.fn.system()`

Solution:
- Replace `vim.fn.system()` with `vim.system({rg_path, '-V'}):wait()`
2025-06-29 14:56:44 +00:00
1c52e90cd5 fix(help): :help can focus unfocusable/hide window #34442
Problem:
:help/:helpgrep/:lhelpgrep can focus unfocusable/hide window

Solution:
Ignore unfocusable/hidden window when reusing help buffer.
2025-06-29 14:44:17 +00:00
63a7b92e58 vim-patch:1fa3f0c: runtime(doc): fix :vmap example to avoid unwanted spaces with JJ (#34695)
fixes: vim/vim#17621
closes: vim/vim#17623

1fa3f0c215

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-29 08:01:12 +08:00
331de6afa6 fix(tui): don't crash when nvim__screenshot() is called with bad path (#34594)
Problem: Currently `vim.api.nvim__screenshot()` crashes when called with an
invalid path. This is because we don't check if `fopen()` returns a null
pointer.

Solution: Bail out if `fopen()` returns a null pointer.

Fixes: https://github.com/neovim/neovim/issues/34593
2025-06-28 23:12:42 +00:00
10a03e83e3 fix(messages): only msg_clear for UPD_CLEAR #34688
Problem:  "msg_clear" is emitted after resizing the screen and during startup.
Solution: Only emit "msg_clear" when `redraw_type == UPD_CLEAR`.
2025-06-28 10:37:21 -07:00
bff7d3fd9f fix(tutor): cannot find tutors in pack/*/start/* #34689
Problems:
- Unlike in Vim, Neovim does not report pack/*/start/* in the resolved value of 'rtp' (see `:help packages-runtimepath`)
- This means that the tutor plugin cannot find the tutors in pack/*/start/*

Solution:
- Use nvim_list_runtime_paths() instead of &rtp
2025-06-28 09:40:24 -07:00
f1f106be3d vim-patch:9.1.1421: tests: need a test for the new-style tutor.tutor (#34267)
Problem:  tests: need a test for the new-style tutor.tutor, patch
          9.1.1384 broke the expected positions for the signs
Solution: Update all number keys in tutor.tutor.json to match the
          correct line numbers in tutor.tutor, replace tabs by spaces,
          add a screen-dump test to verify it does not regress
          (Pham Bình An)

closes: vim/vim#17416

a541f1de2b
2025-06-28 07:42:51 +00:00
c752016976 vim-patch:0312527: runtime(pandoc): sync syntax script with upstream
closes: vim/vim#17598

03125277e9

Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>
2025-06-28 00:13:57 +02:00
4ee2e365a5 fix(lsp): fix workspace diagnostic request to follow spec (#34674)
* fix(lsp): fix workspace diagnostic request to follow spec

* refactor(lsp): add type annotation
2025-06-27 19:17:41 +00:00
f2988e05db feat(extui): don't enter pager for routed message #34679
Problem:  Messages routed to the pager to be shown in full, enter the
          pager automatically, yielding another "press-q-prompt".

Solution: Only enter the pager when requested explicitly. Otherwise,
          close the pager on the next typed mapping, unless that mapping
          entered the pager.
2025-06-27 12:13:01 -07:00