Commit Graph

35347 Commits

Author SHA1 Message Date
zeertzjq
937f64da70 vim-patch:partial:8ee0e0b: runtime(doc): Fix to two-space convention in user manual
closes: vim/vim#15802

8ee0e0b8e3

Co-authored-by: h-east <h.east.727@gmail.com>
2026-02-13 16:39:18 +08:00
glepnir
88dc44260f fix(api): preserve WinConfig style when converting float to split #37264
Problem: When a float window with style='minimal' is converted to a
split window and then changes buffer, the minimal style options get
overridden. This happens because merge_win_config() clears the style
field, so get_winopts() doesn't know to re-apply minimal style after
restoring options from the buffer's wininfo.

Solution: Save and restore the style field when clearing the config
during float-to-split conversion.
2026-02-12 20:23:30 -05:00
zeertzjq
cc7022c544 fix(terminal): scrollback may still be wrong on height increase (#37835)
Problem:  Terminal scrollback may be wrong when increasing height after
          outputting lines with full scrollback.
Solution: Ensure enough number of scrollback lines have been deleted.
2026-02-13 01:06:23 +00:00
zeertzjq
39d8a9c353 vim-patch:9.1.2146: filetype: cel files are not recognized (#37834)
Problem:  filetype: cel files are not recognized
Solution: Detect *.cel files as cel filetype (Stefan VanBuren).

Reference:
https://cel.dev/
e36c49febc/testing/src/test/resources/expressions/coverage_test_case/simple_expression.cel
d0d2dbabae/example.cel

closes: vim/vim#19381

fb5777fa20

Co-authored-by: Stefan VanBuren <svanburen@buf.build>
2026-02-13 08:34:00 +08:00
zeertzjq
844a683641 vim-patch:56033b9: runtime(sh): Fix some ksh-specific deficiencies in syntax script
- Amend syntax highlighting to allow for ksh93 discipline function names
  (e.g. 'foo.get()') and mksh's odd function naming idiosyncrasies
  (shNamespaceOne was introduced to enforce stricter naming rules for
  ksh93 namespaces).
- Remove 'bind' from ksh93 syntax (such a builtin has never been
  implemented in ksh93).
- 'xgrep' is only available in ksh93v- as an alternative way to
  invoke the builtin 'grep -X', so reflect that in the syntax
  highlighting.
- Forbid bash-style 'function name() {' syntax when highlighting
  ksh88 and ksh93 scripts.
- Fix bug causing ' ()' to be incorrectly validated in mksh scripts.
- Add the many ksh93/ksh2020 .sh.* variables to the list of special
  variables.
- Amend iskeyword to allow '.' so that '.sh.tilde.get' and such are
  valid function names/variable names. (For mksh functions starting
  with odd characters like '%' and '@' this would probably have too
  many bad side effects, so I've omitted such a change for that shell.)
- Add new syntax tests and regenerate syntax dump files

closes: vim/vim#19383

56033b9df3

Co-authored-by: Johnothan King <johnothanking@protonmail.com>
2026-02-13 08:29:18 +08:00
zeertzjq
ca701ad947 vim-patch:04c3c68: runtime(sshdconfig): Update syntax
We add new key exchange algorithms and new enums for PubkeyAuthOptions.

We also add new keywords from sshd_config.5 not present here and remove
keywords present here that are not present in the official
documentation, with the exception of those patched in by Debian and
Fedora, as well as ChallengeResponseAuthentication which is deprecated
but still functional.

closes: vim/vim#19347

04c3c6871e

Co-authored-by: Fionn Fitzmaurice <fionn@github.com>
2026-02-13 08:29:18 +08:00
zeertzjq
eaeb2419cf vim-patch:b27934b: runtime(django): add syntax support for partial
Add djangoStatement integrated in version 6. 'partialdef',
'endpartialdef', 'partial'.

[Template Reference: partial](https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#partial)((introduced in Django 6.0)
and 'filter'.

closes: vim/vim#19386

b27934bf8b

Co-authored-by: tecis <67809811+tecis@users.noreply.github.com>
2026-02-13 08:29:18 +08:00
Kevin Goodsell
fa24df3264 fix(bufwrite.c): handle invalid byte sequences #37363
Problem:

bw_rest was used as an extra buffer to save incomplete byte sequences
between calls to buf_write_bytes. Besides being unnecessarily
complicated, this introduced a number of issues:

1) The bytes stored in bw_rest could still be there at the end of
writing the file, never having been written, thus losing some of the
file content on write.

2) bw_rest was not cleared out after the "checking_conversion" phase,
leaving them to affect the written file content during the writing
phase, corrupting the file.

3) bw_rest could contain extra bytes that need to be written to the
output buffer during a buf_write_convert call, potentially before any
bytes are consumed. But some conversions are in-place, without a
separate output buffer. Writing bytes from bw_rest to the "output"
buffer actually overwrote bytes from the input buffer before they were
read, corrupting the data to be written.

4) The extra bytes in bw_rest that need to be written to the conversion
output buffer were not originally accounted for in the size calculation
for the output buffer, causing a buffer overflow (previously fixed in
Vim patch 9.1.2028).

Solution:

Rather than maintaining a separate buffer, the unconverted bytes at the
end of the buffer can just be shifted to the beginning of the buffer,
and the buffer size updated. This requires a bit of refactoring, and
buf_write_convert and buf_write_convert_with_iconv need to report the
number of bytes they consumed so that buf_write_bytes can handle the
remaining bytes.

Following conversion, bw_buf can be checked for any remaining bytes.
Leftover bytes in this case result in a conversion error, which is
better than silently dropping them.

A short section of dead code was removed from buf_write_convert, for
converting a non-UTF-8 buffer to UTF-8. Neovim buffers are always UTF-8.

A few additional tests for iconv conversions have been added. Vim's
iconv tests are disabled in Neovim because they use unsupported values
for 'encoding'.
2026-02-12 17:38:11 -05:00
Elijah Koulaxis
8a0cbf04d6 feat(iter): peek(), skip(predicate) for non-list iterators #37604
Problem:
Iter:peek() only works if the iterator is a |list-iterator| (internally, an `ArrayIter`).
However, it is possible to implement :peek() support for any iterator.

Solution:
- add `_peeked` buffer for lookahead without actually consuming values
- `peek()` now works for function, pairs(), and array iterators
- `skip(predicate)` stops at the first non matching element without consuming it
- keep existing optimized behavior for `ArrayIter` to maintain backward compatibility
- use `pack`/`unpack` to support iterators that return multiple values
2026-02-12 11:55:16 -05:00
phanium
179e7fccd7 fix(ui2): incomplete :echon message in g< pager #37819
Problem:
`:echo 1 | echon 2<cr>g<` shows "2", but should be "12".

Solution:
Don't clear temp msg (g<) if we are appending.
2026-02-12 11:10:37 -05:00
Justin M. Keyes
e8ace82093 Merge #37096 from justinmk/doc2 2026-02-12 08:15:21 -05:00
Michele Campeotto
d0822bbd15 fix(treesitter): highlight group for EditQuery captures #36265
fix(treesitter): more distinctive highlight for EditQuery captures

Problem: EditQuery shows captures in the source buffer using the Title
highlight group, which could be too similar to Normal.

Solution: Use a virtual text diagnostic highlight group: they are
displayed in a similar manner to the query captures so we can assume
that the color scheme should have appropriate styling applied to make
them visible.
2026-02-12 08:07:13 -05:00
Justin M. Keyes
d995142dbd fix(scripts): collect_typos.lua: show commit message on failure 2026-02-12 13:46:53 +01:00
Justin M. Keyes
8a901a52e1 fix(health): avoid silent failure 2026-02-12 13:46:53 +01:00
Justin M. Keyes
5870627a24 docs: vim.fs path expansion
fix #37583
2026-02-12 13:46:53 +01:00
Justin M. Keyes
ec93b786c5 refactor(api): api_buf_ensure_loaded 2026-02-12 13:46:53 +01:00
Justin M. Keyes
858576777e docs: lsp, options, promptbuf
Close #37630
Close #37682
Close #37762
Close #37785

Co-authored-by: Daniel Schmitt <d.schmitt@lansoftware.de>
Co-authored-by: Duane Hilton <duane9@gmail.com>
Co-authored-by: NeOzay <colpaert.benoit@gmail.com>
Co-authored-by: Yi Ming <ofseed@foxmail.com>
Co-authored-by: "Justin M. Keyes" <justinkz@gmail.com>
2026-02-12 13:46:45 +01:00
Justin M. Keyes
fd69b71119 refactor(lsp): drop once(), use _memoize() #37829 2026-02-12 07:15:20 -05:00
zeertzjq
16da47f474 fix(terminal): changing height may lead to wrong scrollback (#37824)
Problem:  Changing terminal height immediately after outputting lines
          may lead to wrong scrollback.
Solution: Insert pending scrollback lines before the old window height.
2026-02-12 20:10:02 +08:00
Christian Clason
ec365a1092 build(deps): bump libuv to v1.52.0 2026-02-12 12:04:51 +01:00
Christian Clason
f4448a9237 build(deps): bump luajit to 233ad2403 2026-02-12 11:34:08 +01:00
zeertzjq
60730482fe test(testterm): remove useless TermCursor highlight definition (#37827)
TermCursor already has cterm=reverse. Additionally, now that terminal
buffers have a real cursor, the cterm=reverse in TermCursor no longer
shows up in the screen state.
2026-02-12 17:31:12 +08:00
wjyoung65
06a78d43f5 docs(dev): fix references to LOG_DEBUG #37825 2026-02-12 04:20:01 -05:00
Andrew Braxton
5468e6a452 fix(pack): skip :redraw! if headless #37782
Otherwise, output will be concatenated without newlines.

TODO: the ":redraw!" call can be dropped entirely after ui2 becomes the default.
2026-02-12 04:15:53 -05:00
skewb1k
6b4ec2264e feat(stdlib): vim.json.decode() can allow comments #37795
Problem:
`vim.json.decode()` could not parse JSONC (JSON with Comments)
extension, which is commonly used in configuration files.

Solution:
Introduce an `skip_comments` option, which is disabled by default. When
enabled, allows JavaScript-style comments within JSON data.
2026-02-11 06:54:57 -05:00
Yochem van Rosmalen
3567b7d751 fix: ignore Nvim local config #37805
Problem:
Presumably Neovim contributors use Neovim to write the contributed code.
Chances are that they have some local Neovim-source-specific config, for
example setting the $TEST_FILE and 'makeprg' for files in test/.

Solution:
Ignore it.
2026-02-11 06:17:29 -05:00
zeertzjq
886efcb853 fix(channel): possible hang after connecting with TCP times out (#37813)
Problem:  Possible hang after connecting with TCP times out.
Solution: Wait for the close callback to arrive.
2026-02-11 02:48:03 +00:00
zeertzjq
64ce5382bd fix(channel): crash on failed sockconnect() (#37811)
Problem:  Crash on failed sockconnect() if a new connection is accepted
          while polling for uv events.
Solution: Don't use channel_destroy_early().

Also test "tcp" mode failure properly.
2026-02-11 01:34:38 +00:00
zeertzjq
3e843a2891 vim-patch:36f4498: runtime(java): Allow for org.TopLevelType.NestedType return types (#37810)
vim-patch:36f4498: runtime(java): Allow for org.TopLevelType<T>.NestedType return types

closes: vim/vim#19349

36f4498710

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2026-02-11 08:02:50 +08:00
zeertzjq
d1238b9da4 vim-patch:61e96c5: runtime(doc): Fix typo in runtime/doc/cmdline.txt (#37809)
closes: vim/vim#19378

61e96c5a95

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-02-11 08:02:23 +08:00
zeertzjq
1e9143879d refactor(terminal.c): move screen callbacks together (#37808)
Misplaced term_sb_clear() when rebasing #21412.
2026-02-11 06:36:49 +08:00
Olivia Kinnear
0c46ea7d38 feat(lua): add Iter:unique() (#37592) 2026-02-10 11:43:47 -06:00
Evgeni Chasnovski
14c708634e fix(vim.fs): make rm() work with symlink to a directory 2026-02-10 16:40:12 +00:00
zeertzjq
c3defb4b45 vim-patch:5ed3723: runtime(ruby): Update for Vim 9.2 release (#37806)
closes: vim/vim#19316

5ed37232bb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-10 22:14:21 +08:00
Yochem van Rosmalen
a6252c6683 refactor(help): move escaping logic to Lua #37757
Problem:
Escaping logic for {subject} in ex cmd `:help {subject}` is done in a
messy 200+ lines C function which is hard to maintain and improve.

Solution:
Rewrite in Lua. Use `string.gsub()` instead of looping over characters
to improve clarity and add many more tests to be able to confidently
improve current code later on.
2026-02-10 07:43:17 -05:00
glepnir
16c8a908ef fix(health): check stable release for non-nightly build #36715
Problem:
Nvim version is always compared to latest upstream HEAD.

Solution:
If current Nvim is not a nightly build, check upstream stable version.
2026-02-10 06:17:37 -05:00
glepnir
b7070778b9 fix(api): cterm type in highlight keyset #37802
Problem: cterm field in Dict(highlight) is declared as Union(Integer, String)
but it actually expects a Dict(highlight_cterm).

Solution: change cterm type to DictAs(highlight__cterm) and simplify the
handling in dict2hlattrs since type validation and empty array compat are
already handled by api_dict_to_keydict.
2026-02-10 06:05:53 -05:00
glepnir
31c45f1aa4 test: move deprecated highlight API tests #37801
Problem: Tests for deprecated highlight API were mixed with current API tests.

Solution: Move them to deprecated_spec.lua and update highlight_spec.lua to use nvim_get_hl.
2026-02-10 05:38:13 -05:00
zeertzjq
57fc77ed29 Merge pull request #37798 from zeertzjq/vim-e92998e
vim-patch: runtime file updates
2026-02-10 07:06:07 +08:00
zeertzjq
32c94621ad vim-patch:9e456e5: runtime(doc): clarify the use of 'iskeyword' option value
In particular, also mention the difference between the regex atom \k and
what Vim considers for a word character.

closes: vim/vim#18688

9e456e52df

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-10 06:44:30 +08:00
zeertzjq
0aacc043a3 vim-patch:4442ac5: runtime(nginx): Update nginx syntax script
closes: vim/vim#19374

4442ac53f7

Co-authored-by: Chris Aumann <me@chr4.org>
2026-02-10 06:42:48 +08:00
zeertzjq
8fb1a8d4ca vim-patch:e92998e: runtime(nginx): highlight Lua in set_by_lua_block in syntax script
The set_by_lua_block directive of the Lua module takes an additional
variable as an argument which currently breaks the detection of inline
Lua blocks. For example:

    set_by_lua_block $myvar {
        return tonumber(ngx.var.myothervar)-1
    }

closes: vim/vim#19362

e92998ea4d

Co-authored-by: Josef Schönberger <josef.schoenberger@tum.de>
2026-02-10 06:42:35 +08:00
zeertzjq
54468c1c3c fix(terminal): wrong scrollback with nvim_open_term() on buffer (#37791)
Problem:  Wrong scrollback when passing a buffer with many lines to
          nvim_open_term().
Solution: Delete all buffer lines before opening the terminal.

I tried to use buf_clear(), but it crashes inside deleted_lines_mark(),
so I'll just use deleted_lines_buf() for now. The behavior of marks can
be decided later.
2026-02-10 06:30:02 +08:00
Starman
4b2cbc2154 build(desktop): declare "Development" category #37794 2026-02-09 16:55:37 -05:00
phanium
9f77124b78 fix(lsp): error on omnifunc completion (#37790)
Problem:
After eaacdc9, complete with emmylua_ls error with:
runtime/lua/vim/lsp/completion.lua:586: attempt to get length of field
'items' (a nil value)

Solution:
Result can be CompletionItem[] according the spec:
> If a `CompletionItem[]` is provided, it is interpreted to be complete,
> so it is the same as `{ isIncomplete: false, items }`
2026-02-09 09:45:21 -08:00
Yochem van Rosmalen
1ee166a64d docs(quickfix): fix tag format for CTRL mappings #37793
Problem:
Mappings with a control modifier follow the (tag) format of:

	{key_before}_CTRL-{key}_{key_after}

Where `{key_before}` and `{key_after}` can be any other key combination.
However, for the Nvim default mappings `[_CTRL-Q`, `]_CTRL-Q`,
`[_CTRL-L`, `]_CTRL-L`, `[_CTRL-T` and `]_CTRL-T`, the underscore
between the bracket and CTRL was absent. This lead to problems finding
the relevant docs with `:help [_CTRL-Q` and made parsing the {subject}
argument for `:help` harder.

Solution:
Use the right tag format.
2026-02-09 12:13:24 -05:00
Sean Dewar
1b627f6c59 fix(terminal): set b_locked when setting &buftype (#37787)
Problem: heap use-after-free if OptionSet autocommands from setting a terminal's
&buftype wipe the buffer.

Solution: set b_locked during OptionSet for &buftype.
2026-02-09 12:51:04 +00:00
Nanashi.
7ee41a4b33 test: add failing case for screenrow/screencol #37761 2026-02-09 07:19:50 -05:00
zeertzjq
e254688016 fix(terminal): handle ED 3 (clear scrollback) properly (#21412)
Problem:  Terminal doesn't handle ED 3 (clear scrollback) properly.
Solution: Add vterm callback for sb_clear().

Also fix another problem that scrollback lines may be duplicated when
pushing to scrollback immediately after reducing window height, as can
be seen in the changes to test/functional/terminal/window_spec.lua.
2026-02-09 11:28:00 +00:00
zeertzjq
6ad73421cb vim-patch:b422a33: runtime(gdb): Update syntax and ftplugin (#37783)
- Change syntax file maintainer.
- Add Guile and Python command highlighting.
- Update command list to version 12.
- Add foldable regions for the commands 'define', 'if' and 'while'
  multiline commands.
- Support documented partial command names.
- Add matchit, browsefilter, and comment formatting support.
- Support embedded C in compiler {code|print} commands.
- Add largely complete settings highlighting and folding.
- Add syntax tests (incomplete).

Thanks to Claudio Fleiner for many years of maintenance.

closes: vim/vim#10649

b422a33ac2

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-09 00:19:39 +00:00