Commit Graph

37526 Commits

Author SHA1 Message Date
Jan Edmund Lazo
0aed30b4de build(vim-patch): misc n/a funcs, headers, err msgs #41116
* build(vim-patch): n/a func in version.c

init_longVersion() sets datetime for ":version".
Nvim removed it for more deterministic builds.

* build(vim-patch): n/a header from amiga

* build(vim-patch): n/a vim9 err msg for declaring vars

* build(vim-patch): nvim support.txt replaces *os-support*

* build(vim-patch): vim xdg is n/a

* build(vim-patch): n/a 1-line err msg

Vim error message can be 1-line (globals.h), not multi-line (errors.h).
Target v8.2.1032
2026-08-03 05:33:32 -04:00
Freddie Haddad
9ff302d0ca fix(ui): highlight bleeds into 'linebreak' filler #41072
Problem:
When 'linebreak' pushes a word entirely to the next screen row, the
filler cells left on the current row keep whatever highlight was set
by the last real character before the break, even when that highlight
should not extend past it (e.g. an underline, which looks broken drawn
over blank cells).

Solution:
Reset decor_attr and area_attr at the filler when their attribute has
an underline, undercurl, strikethrough, or overline; otherwise leave
them, since a plain background or reverse-video highlight looks
correct extending through blank filler cells, regardless of where the
pushed-down word happens to end. search_attr keeps the same check,
plus its pre-existing on_last_col case (its own match ending exactly
here).
2026-08-03 05:20:04 -04:00
zeertzjq
1f4335fe72 vim-patch:partial:9.2.0899: command output temporary files may collide (#41123)
Problem:  On MS-Windows, get_cmd_output() removes its reserved temporary
          file before the shell opens it, allowing another Vim process to
          reuse the same name.
Solution: Keep the temporary file reserved until command output handling is
          complete (Sam Roeca).

closes: vim/vim#20915

0db0c3c142

Co-authored-by: Sam Roeca <samuel.roeca@gmail.com>
2026-08-03 06:39:00 +08:00
zeertzjq
a5a294c825 vim-patch:9.2.0895: test: Test_aucmd_win_scroll_multibyte() is flaky in the GUI (#41121)
Problem:  The test comparing the top line before and after using the
          autocommand window is flaky in the GUI.
Solution: Run the test in a window with a fixed size.  In the GUI a
          pending resize of the shell is applied at the end of a screen
          update, thus the size may change between the two measurements.

related: vim/vim#20884
closes:  vim/vim#20913

85b8034dff

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 06:38:43 +08:00
Freddie Haddad
67839a72f7 fix(treesitter): make TSHighlighter.new() idempotent for an active buffer #41090
Problem:
Calling vim.treesitter.start() a second time on a buffer that already
has an active TSHighlighter creates a brand new instance instead of
reusing it, whether the parser tree is unchanged (e.g. calling start()
twice) or different (e.g. switching languages). Either way the old
instance is silently discarded without calling :destroy() on it, so
its on_bytes/on_changedtree/on_detach callbacks stay registered and
its buffer-local state (spelloptions, decoration namespace) is never
restored, both leaking indefinitely for an orphaned instance that
nothing references anymore.

Solution:
Return the existing instance when TSHighlighter.active[source] is
already set for the same parser tree, instead of unconditionally
constructing a new one. When the tree differs instead (e.g. a language
switch), destroy() the old instance first, matching stop() semantics,
before constructing the new one.
2026-08-02 14:42:47 -04:00
Rob Pilling
2f09090134 fix(ui2): :$q should not target hidden windows #40992
Similar to #36123, the ui2 windows confuse `:$q`, which doesn't close
the last window on the tab, but targets a hidden ui2 window.

The problem seems to be a combination of using
`FOR_ALL_WINDOWS_IN_TAB()`, which includes hidden windows, and then
counting the windows without factoring in `win_has_winnr()`.

There are examples of using `win_has_winnr()`, such as:
- [`eval/buffer.c`'s `buf_win_common()`](4a5062cda6/src/nvim/eval/buffer.c (L474-L475))
- [`eval/window.c`'s `f_getwininfo()`](4a5062cda6/src/nvim/eval/window.c (L130-L135))
- [`window.c`'s `win_get_tabwin()`](4a5062cda6/src/nvim/window.c (L7860-L7869))

But possibly problematic ones:
- `ex_docmd.c`'s:
	- [`invalid_range()`](4a5062cda6/src/nvim/ex_docmd.c (L3891-L3893))
		- ^ should this include hidden windows? Can a user address them by number? `win_has_winnr()` suggests not
	- [`ex_close()`](4a5062cda6/src/nvim/ex_docmd.c (L5233-L5244))
	- [`ex_hide()`](4a5062cda6/src/nvim/ex_docmd.c (L5478-L5484))
- `eval/window.c`'s:
	- [`f_winrestcmd()`](4a5062cda6/src/nvim/eval/window.c (L797-L808))
	- [`find_win_by_nr()`](4a5062cda6/src/nvim/eval/window.c (L172-L180))
2026-08-02 14:37:26 -04:00
neil
ecae8c994e ci: check FreeBSD, OpenBSD builds #41091
FreeBSD and OpenBSD are Tier 2 supported platforms (:help
supported-platforms) but have had no CI coverage since Cirrus CI was
dropped in #39321. Restore build coverage for both using vmactions,
which boots the VM on a regular ubuntu-latest runner.
2026-08-02 14:30:23 -04:00
Ro
3b85a689ab docs(api): rpc examples #41077 2026-08-02 08:19:29 -04:00
Justin M. Keyes
f7fbe0e0c8 Merge #41106 from altermo/selection-refactor-fix 2026-08-02 05:33:17 -04:00
github-actions[bot]
7604aa5ef0 docs: update version.c #41092
vim-patch:8.2.0110: prop_find() is not implemented
vim-patch:8.2.0318: Vim9: types not sufficiently tested
vim-patch:8.2.0518: a terminal falls back to setting $TERM to "xterm"
vim-patch:8.2.0543: Vim9: function with varargs does not work properly
vim-patch:8.2.0571: double free when passing invalid argument to job_start()
vim-patch:8.2.0582: color ramp test does not show text colors
vim-patch:8.2.1641: Vim9: cannot use 0 or 1 where a bool is expected
vim-patch:8.2.1692: build fails because TTFLAG_STATIC is missing
vim-patch:8.2.1855: Vim9: get error message when nothing is wrong
vim-patch:8.2.3104: Vim9: unspecified function type causes type error
vim-patch:8.2.3479: crash when calling job_start with an invalid argument
vim-patch:8.2.3481: failures when char is unsigned
vim-patch:9.0.1377: job_status() may return "dead" if the process parent changed
vim-patch:9.0.2084: Vim9: abstract static methods are possible
vim-patch:9.1.0751: Error callback for term_start() not used
vim-patch:9.1.1094: Vim9: problem finding implemented method in type hierarchy
vim-patch:9.2.0889: VMS: spurious "INVALID DECC FEATURE VALUE" message at every startup
vim-patch:6351c1775 CI: Bump github/codeql-action
vim-patch:64b0196a9 runtime(doc): remove todo entry for test_codestyle errors

vim-patch:8.2.0073: initializing globals with COMMA is clumsy
vim-patch:8.2.0253: crash when using :disassamble without argument
vim-patch:8.2.0306: Vim9: :substitute(pat(repl does not work in Vim9 script
vim-patch:8.2.0311: Vim9: insufficient script tests
vim-patch:8.2.0486: Vim9: some code and error messages not tested
vim-patch:8.2.0529: Vim9: function argument with default not checked
vim-patch:8.2.0530: test crashes on s390
vim-patch:8.2.0604: :startinsert in a terminal window used later
vim-patch:8.2.0652: compiler warning for char conversion
2026-08-02 05:30:14 -04:00
Justin M. Keyes
825cb3790e Merge #41103 from janlazo/na-hunk-header 2026-08-02 05:23:38 -04:00
Justin M. Keyes
fe10c5bc36 test(fs): "fs.find() follows symlinks" #41105
Problem:
Test fails if other "build*/" dirs exist with a "nvim" file, e.g.
`build-asan/bin/nvim`.

Solution:
Do the test in an isolated dir.
This also fixes the test for the zig build.
2026-08-02 05:09:58 -04:00
zeertzjq
a5103c0853 vim-patch:9.2.0892: highlight: wrong column highlighted with 'cursorcolumn' (#41110)
Problem:  With 'virtualedit' set to "all" and 'cursorcolumn' set, the wrong
          column may be highlighted after a command that moved the cursor
          into virtual space and back (van-de-bugger).
Solution: Make sure the virtual column is up to date before drawing the
          window (Hirohito Higashi).

fixes:  vim/vim#2576
closes: vim/vim#20902

5a90b9dbd2

Test only. This was already fixed by #39159.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 02:20:11 +00:00
zeertzjq
e9190e9c4f vim-patch:9.2.0894: filetype: ed script files not recognised (#41109)
Problem:  filetype: ed script files not recognised.
Solution: Add filetype detection for *.ed files and shebang lines,
          include syntax script and syntax tests.

Features of the ed syntax file:
- BSD and GNU extensions are supported
- Andrew L. Moore's ed extensions are not supported
- Rebuild synmenu.vim

closes: vim/vim#19602

c28515b999

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-08-02 09:56:10 +08:00
zeertzjq
ad2ae824ec fix(move): using wrong window width (#41108) 2026-08-01 23:18:29 +00:00
Justin M. Keyes
98d767cd53 docs: func/expr options, misc #41102 2026-08-01 17:48:32 -04:00
Jan Edmund Lazo
51da48c8f8 build(vim-patch): libvterm color_ramp.vim is n/a for nvim 2026-08-01 13:22:49 -04:00
Jan Edmund Lazo
92544471e0 build(vim-patch): "build_argv_from_" api is n/a
Meant for Vim job, terminal, cscope, etc.
Incompatible with Nvim implementation.
2026-08-01 13:03:20 -04:00
altermo
8695579636 fix(treesitter): handle &selection=exclusive 2026-08-01 18:21:59 +02:00
altermo
77dfa02f3e refactor: combine all visual_selection funcions 2026-08-01 18:20:13 +02:00
altermo
fe8e6a7efa test(lsp-selection): of by one
The test uses the position col=5,row=5; but such a position
is outside of the buffer.

Presume that it was meant to be col=5,row=4...
2026-08-01 18:15:23 +02:00
Justin M. Keyes
d060d91ef8 fix(bufwrite): coverity "uninitialized member" #41104
CID 652079:           (UNINIT)
    /src/nvim/bufwrite.c: 1413             in buf_write()
    1407         // only makes sense at the start of the file.
    1408         if (buf->b_p_bomb && !write_bin && (!append || perm < 0)) {
    1409           write_info.bw_len = make_bom(buffer, fenc);
    1410           if (write_info.bw_len > 0) {
    1411             // don't convert
    1412             write_info.bw_flags = FIO_NOCONVERT | wb_flags;
    >>>     CID 652079:           (UNINIT)
    >>>     Using uninitialized value "write_info.bw_first" when calling "buf_write_bytes".
    1413             if (buf_write_bytes(&write_info) == FAIL) {
    1414               end = 0;
    1415             } else {
    1416               nchars += write_info.bw_len;
    1417             }
    1418           }
    /src/nvim/bufwrite.c: 1453             in buf_write()
    1447               *s = c;
    1448             }
    1449             s++;
    1450             if (++write_info.bw_len != bufsize) {
    1451               continue;
    1452             }
    >>>     CID 652079:           (UNINIT)
    >>>     Using uninitialized value "write_info.bw_first" when calling "buf_write_bytes".
    1453             if (buf_write_bytes(&write_info) == FAIL) {
    1454               end = 0;                        // write error: break loop
    1455               break;
    1456             }
    1457             nchars += bufsize - write_info.bw_len;
    1458             s = buffer + write_info.bw_len;
2026-08-01 12:15:02 -04:00
Justin M. Keyes
e02755cd9f fix(options): ":set foo?" for Lua callbacks #41100
Problem:
`:set foo=<tab>` and `:set foo?` for func/expr options set to a Lua
function, always displays "v:lua".

The existing "<Lua N: file:line>" form was avoided because the ref id
N changes on every read of the same option.

Solution:
- Don't attempt to tab-complete Lua functions.
- Show "<Lua file:line>" (or "<Lua>" if source file is unknown).

Example:

    :set operatorfunc?
      operatorfunc=<Lua ~/.config/nvim/init.lua:42>
2026-08-01 10:07:26 -04:00
Jan Edmund Lazo
af1b82fc7b build(vim-patch): vim "mch_job_" api is n/a 2026-08-01 09:17:49 -04:00
Jan Edmund Lazo
d95b0fc12c build(vim-patch): n/a vim9 struct from *.h
Target v8.2.0543
This can catch stray '#define' but they're most likely 'TTFLAG' for
Vim9 types. N/A.
TTFLAG is used in 'static_types[]'.
See v9.0.0623.
2026-08-01 09:14:13 -04:00
AlexCodesApps
b11f1b1f76 feat(vim.fs): abspath({cwd, plain}) #40597
Adds optional parameters to `vim.fs.abspath`:
1. `cwd` to specify directory akin to `--relative-from` in `realpath(1)`.
2. `plain` disables expansion of tilde (~) in paths.
2026-08-01 09:09:21 -04:00
Jan Edmund Lazo
9fbcb28ea6 build(vim-patch): N/A prop func defs, n/a vim9 type vars (#41089) 2026-08-01 06:23:08 -04:00
Jan Edmund Lazo
0df53062df vim-patch:8.2.0232: the :compiler command causes a crash (#41087)
Problem:    The :compiler command causes a crash. (Daniel Steinberg)
Solution:   Do not use the script index if it isn't set.

----

ex_vim9script() is N/A.

----

165315584d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-01 17:45:41 +08:00
zeertzjq
7b28b1f4a9 Merge pull request #41085 from zeertzjq/vim-9.2.0883
vim-patch:9.2.{0883,0884,0885,0887}
2026-08-01 09:36:56 +08:00
zeertzjq
86bbe41459 vim-patch:9.2.0885: scroll: 'smoothscroll' position is lost when the window is squeezed
Problem:  With 'smoothscroll' the scroll position in a long line is lost when
          a window is temporarily squeezed to a couple of lines, for example
          when opening and closing a help window.
Solution: When the cursor ends up in the skipped columns, skip up to the
          screen line the cursor is in instead of showing the start of the
          line.

closes: vim/vim#20892

15f8ba5cec

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 08:30:39 +08:00
zeertzjq
b08c588238 vim-patch:9.2.0884: scroll: unreachable 'smoothscroll' code in cursor_correct()
Problem:  cursor_correct() checks for 'smoothscroll' with 'wrap' off, a
          combination where 'smoothscroll' has no effect.
Solution: Remove the check, adjust_skipcol() already handles the case where
          the cursor line just fits in the window.

closes: vim/vim#20891

2ea497f072

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 08:28:56 +08:00
zeertzjq
d9525e23f3 vim-patch:9.2.0883: scroll: 'smoothscroll' position is lost when using "|"
Problem:  With 'smoothscroll' the scroll position in a long line is lost when
          moving to a column with "|".
Solution: Adjust the skipped columns for the column the cursor ends up in,
          not for column zero.

related: vim/vim#20885
closes:  vim/vim#20890

5ed8fc10fa

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 08:27:52 +08:00
zeertzjq
f129b5428a vim-patch:e31fb9b: runtime(lf): update syntax to support lf version r42 (#41083)
closes: vim/vim#20897

e31fb9bb67

Co-authored-by: CatsDeservePets <145048791+CatsDeservePets@users.noreply.github.com>
2026-08-01 08:25:29 +08:00
zeertzjq
f8872bccbe vim-patch:9.2.0882: :bwipe crashes if WinLeave wipes all other buffers (#41082)
Problem:  :bwipe crashes if WinLeave wipes all other buffers
          (after 9.1.2068).
Solution: Check for NULL pointer.

related: neovim/neovim#41066
closes: vim/vim#20888

3e4019a082
2026-07-31 23:25:28 +00:00
Justin M. Keyes
4836ecad1f Merge #41065 from justinmk/optionfunc
feat(options): Lua closure/function options
2026-07-31 18:01:51 -04:00
Justin M. Keyes
102e806320 refactor(options): simplify "unset" logic 2026-07-31 21:50:04 +02:00
Justin M. Keyes
3e01dcddbe refactor(options): memory management
Problem:
Numerous callers have to manually check optval ownership (i.e. whether,
and how, to release) via `is_callback_option`, `option_is_global_local`,
etc. This is fragile, hard to use correctly; and if we introduce another
optval variant in the future, we'll have to redo all of these careful
checks and boilerplate again.

Solution:
Provide a unified system and use it everywhere:

    optval_free_owned
    optval_is_owned
    optval_own
2026-07-31 21:50:04 +02:00
Justin M. Keyes
726d1a92d2 feat(options): lua closure/function options
Problem:
Cannot assign Lua functions/closures to "func" ('completefunc',
'tagfun', …) or "expr" ('foldexpr', 'indentexpr', …) options.

Solution:
- Store "func"/"expr" options as `Callback` instead of string.
- Delete oceans of copy-pasted code.
- BREAKING: LuaRef returned via RPC/Vimscript is now represented as
  `"<Lua N: file:line>"` (like what `:map` shows) instead of `nil`.
- Note: `man.vim` still uses `v:lua` string, bc it's a vimscript ftplugin.

Helped-by: Lewis Russell <lewis6991@gmail.com>
2026-07-31 21:50:04 +02:00
Justin M. Keyes
917232b508 Merge #40953 from barrettruth/feat/zip-extract
feat(zip): extract archive entries
2026-07-31 15:45:14 -04:00
Jan Edmund Lazo
02a25caa1b build(vim-patch): N/A diffs from vim9 err msgs #41070 2026-07-31 05:09:43 -04:00
github-actions[bot]
25d5fe34a8 docs: update version.c #41041
vim-patch:decab25ac runtime(doc): Vim9: dictionary in a lambda block is not documented
vim-patch:f594f41e7 runtime(doc): regenerate help tags
vim-patch:61997d8ce translation(it): Update Italian man page
vim-patch:9.2.0876: GTK4: compile error with disabled netbeans feat
vim-patch:9.2.0877: Vim9: crash when a closure assigns to a variable declared in a loop
vim-patch:9.2.0878: Vim9: cannot use a script variable of an enclosing block in a lambda
vim-patch:9.2.0879: popup: "maxwidth" is not respected when 'wrap' is off
vim-patch:902db1d7a runtime(doc): update todo for the remaining 'smoothscroll' scroll position

vim-patch:9.1.0045: --remote-* does not ignore wilidignore
2026-07-31 05:00:21 -04:00
zeertzjq
a35c604718 Merge pull request #41071 from zeertzjq/vim-9.2.0880
vim-patch:9.2.{0880,0881}
2026-07-31 12:23:28 +08:00
zeertzjq
f7cc79edf4 vim-patch:9.2.0881: 'smoothscroll' position is lost when the window height changes
Problem:  With 'smoothscroll' the scroll position of a window is lost when
          its height changes.
Solution: Only reset the skipped columns when 'smoothscroll' is off, where
          they just serve to keep the cursor visible.

closes: vim/vim#20885

17f3923b8c

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 11:22:27 +08:00
zeertzjq
f9040dbe03 vim-patch:9.2.0880: scroll: window scrolls when using the autocommand window
Problem:  The window scrolls when an autocommand window is used while the
          cursor is behind multi-byte characters.
Solution: Use the byte column instead of the character count when computing
          how many screen lines the text up to the cursor takes.

fixes:  vim/vim#12085
closes: vim/vim#20884

7fe3ea7658

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 11:22:26 +08:00
zeertzjq
9d7c004ade Merge pull request #41069 from zeertzjq/vim-b0e0b22
vim-patch: runtime file updates
2026-07-31 10:48:46 +08:00
zeertzjq
41378d4610 vim-patch:e241ac0: runtime(zip): fix failure on Windows CI
Problem:  The zip autoload script aborts loading when the "zip"
          command is not available, so even read-only browsing of an
          archive fails with E117 (zip#Browse undefined) on systems
          that have "unzip" but not "zip" (e.g. the Windows CI
          runner).  Regressed in b0e0b22.
Solution: Drop the load-time executable gate and check each command
          per operation instead, so a missing "zip" only affects
          writing.  Update the test to match the reworded message.

e241ac0a62

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-07-31 09:32:40 +08:00
zeertzjq
659259d736 vim-patch:99921ff: runtime(marko): improve syntax highlighting
closes: vim/vim#20874

99921ffc39

Co-authored-by: Brian Carbone <brian@briancarbone.com>
2026-07-31 09:28:56 +08:00
zeertzjq
0e3e15d161 vim-patch:b0e0b22: runtime(zip): Improve Compatibility for powershell 5 and pwsh 7
related: vim/vim#20832

b0e0b22535

Co-authored-by: curbe454 <asu454@outlook.com>
Co-Authored-By: curbe454 <asu454@outlook.com>
2026-07-31 09:28:28 +08:00
Justin M. Keyes
6cdab150bc docs: misc #41063 2026-07-30 15:09:19 -04:00
Justin M. Keyes
a7f422fa48 refactor(options): naming #41046
- "obj" refers to structured (non-scalar `Object`) option values.
- "optval" generally refers to the internal scalar (legacy ":set"-style)
  option value.
2026-07-30 09:50:26 -04:00