Commit Graph

34151 Commits

Author SHA1 Message Date
zeertzjq
f4e4799f27 docs: small fixes (#36146)
Close #35989
Close #36031
Close #36107

Co-authored-by: Kieran Moy <kfatyuip@gmail.com>
Co-authored-by: William Sprent <william@sprent.dk>
Co-authored-by: David Briscoe <43559+idbrii@users.noreply.github.com>
2025-10-12 12:16:14 +08:00
Vlad
2ea7333f64 test(plugin/pack_spec): handle pcall path truncation #36143
Problem

In `vim.pack` the source of any errors is included in the `update`
buffer from lua's `pcall` method. Since the full path is known it is
replaced in the unit test by the string `VIM_PACK_RUNTIME`. The issue is
that `pcall` does not necessarily include the full path, it instead uses
the `lua_Debug` `short_src` value which can be truncated. This means
depending on where you've cloned the repo locally the test can fail.

Solution

Change the replacement pattern for the traceback to be more generic and
handle any path prefix, not just the value of `vim.env.VIMRUNTIME`.
2025-10-12 03:23:19 +00:00
glepnir
072f126453 fix(ui): 'pumborder' parsing, shadow #36127
Problem:
1. Setting `pumborder=+,+,+,+,+,+,+,+` failed to render the custom
   border characters correctly. The issue occurred in `parse_winborder()`
   where it incorrectly used `p_winborder` instead of the `border_opt`
   parameter when the option value didn't contain commas.
2. In `pum_redraw()`, calling `parse_border_style()` directly with the
   option string failed to parse comma-separated border characters.
3. Missing documentation for PmenuShadow and PmenuShadowThrough
   highlight groups used by the shadow border style.
4. Coverity reports CID 631420: passing WinConfig (480 bytes) by value
   in `grid_draw_border()`.
5. crash when using `shadow` value on pumborder.

Solution:
1. Fix `parse_winborder()` to use `border_opt` parameter consistently,
   ensuring the correct option value is parsed regardless of which
   option (winborder/pumborder) is being set.
2. Update `pum_redraw()` to call `parse_winborder()` instead of
   `parse_border_style()`, properly handling both predefined styles
   and custom comma-separated border characters.
3. Add documentation for PmenuShadow (blended shadow areas) and
   PmenuShadowThrough (see-through corners) highlight groups.
4. Change `grid_draw_border()` to accept WinConfig by pointer.
5. When the "shadow" style is used, no additional row and column offset
   is applied, and the border width is reduced.
2025-10-11 19:48:27 -07:00
luukvbaal
c7fd0c17b1 fix(window): don't make hidden/unfocusable previous window current #36142
Problem:  Previous window is made current while it is unfocusable/hidden.
Solution: Treat hidden/unfocusable window as an invalid previous window.
2025-10-11 19:41:09 -07:00
Tomas Slusny
fec02ae8e4 feat(plugins): nvim.difftool can compare directories #35448
Problem:
Built-in diff mode (nvim -d) does not support directory diffing
as required by git difftool -d. This makes it difficult to compare
entire directories, detect renames, and navigate changes efficiently.

Solution:
Add a DiffTool plugin and command that enables side-by-side diffing of
files and directories in Neovim. The plugin supports rename detection,
highlights changes in the quickfix list, and provides a user command for
easy invocation. This allows proper integration with git difftool -d for
directory comparison.

Example git config:

```ini
[diff]
    tool = nvim_difftool

[difftool "nvim_difftool"]
    cmd = nvim -c "packadd nvim.difftool" -c "DiffTool $LOCAL $REMOTE"
```

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-10-11 19:24:39 -07:00
zeertzjq
bc2fe135d1 vim-patch:6800da6: runtime(doc): Add missing optional tail command-name specs (#36140)
- Use the optional tail command-name specs at help entries for :keepalt,
  :lcd, :cfdo, :lfdo, :wundo, :rundo, :bdelete and :bunload.
- Add missing shortname tags.

closes: vim/vim#18547

6800da6ff1

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-11 23:41:13 +00:00
zeertzjq
b261515775 vim-patch:37aabac: runtime(doc): update credit section for Girish Palya (#36132)
closes: vim/vim#18544

37aabaca64

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-10-12 07:04:53 +08:00
atusy
97ab24b9c7 fix(lsp): _get_workspace_folders does not handle root_dir() function #36071
* fix(lsp): type of root_dir should be annotated with string|fun|nil
* feat(lsp): support root_dir as function in _get_workspace_folders
* feat(lsp): let checkhealth support root_dir() function

Examples:

    vim.lsp: Active Clients ~
    - lua_ls (id: 1)
      - Version: <Unknown>
      - Root directories:
          ~/foo/bar
          ~/dev/neovim

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-10-11 16:01:05 -07:00
phanium
020d5e0f7e fix: stale lines("w$") after nvim_win_set_height when splitkeep=screen #36056
Problem: when splitkeep=screen, after enlarge float window with
nvim_win_set_height, lines("w$") return stale value

Solution: update in win_set_inner_size
2025-10-11 14:48:39 -07:00
Yochem van Rosmalen
26bd9bfab8 fix(undotree): highlight extmarks like normal text #36087
Problem:
Difference in highlight color between normal lines and extmark lines is
distracting and conveys little information.

Solution:
Set extmarks highlight to the Normal group.
2025-10-11 13:39:51 -07:00
Justin M. Keyes
8809c59ffd Merge #36126 vim-patch:8.2.{4851,4878},9.0.1427 2025-10-11 15:54:36 -04:00
Till Bungert
28157738e3 fix: vim.lsp.omnifunc should not throw away other items #35346 2025-10-11 12:42:14 -07:00
Ethan Praeter
9e66c0de69 fix(coverity/532421) removed logically dead code #36101 2025-10-11 12:21:05 -07:00
Sean Dewar
3ccba4cdff fix(float): crash from nasty :fclose autocmds (#36134)
Problem: :fclose may crash Nvim if autocommands close floats prematurely.
Alternatively, :fclose may call win_close for windows not in curtab if
autocommands change curtab or move windows between tab pages via
nvim_win_set_config (may not crash, but is wrong).

Solution: check win_valid before calling win_close.
2025-10-11 18:08:24 +01:00
luukvbaal
150490d365 fix(conceal): assert tripped during startup #36136
Problem:  Row assertion for concealed lines trips during startup.
Solution: Remove the assertion and return early instead.
2025-10-11 09:22:18 -07:00
Rob Pilling
ce27423132 feat: ":wall ++p" creates parent dirs for each buf #36121
`:wall ++p` will create parent directories if they do not exist, for
each modified buffer
2025-10-11 08:27:58 -07:00
Jan Edmund Lazo
69bed0431c vim-patch:9.0.1427: warning for uninitialized variable
Problem:    Warning for uninitialized variable. (Tony Mechelynck)
Solution:   Add #ifdef.

1f76138ff1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-10-11 11:05:30 -04:00
Jan Edmund Lazo
b6d0c391fc vim-patch:8.2.4878: valgrind warning for using uninitialized variable
Problem:    Valgrind warning for using uninitialized variable.
Solution:   Initialize the type of newtv.

dd7eff0a75

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-10-11 10:41:53 -04:00
Jan Edmund Lazo
90b1202cfb vim-patch:8.2.4851: compiler warning for uninitialized variable
Problem:    Compiler warning for uninitialized variable.
Solution:   Use another variable to decide to restore option values.

b4011afe53

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-10-11 09:54:35 -04:00
Vlad
f0b9232ad8 test(plugin/shada_spec): always use UTC formatted date (#36128)
Problem

Similar to https://github.com/neovim/neovim/pull/33257, but for the date
component. When timezone is behind UTC the epoch date of individual
components mismatch causing the test to fail.

Solution

The `epoch` variable is created using `os.date` with a `!`, which means
format the date in UTC instead of local timezone:
https://www.lua.org/manual/5.1/manual.html#pdf-os.date.

Since the individual components like year, month, and day are expected
to match `epoch` they should all be created using a `!` as well.
2025-10-11 06:03:02 +00:00
phanium
f40672be99 fix(undotree): clear autocmd correctly #36124
Problem: nvim_clear_autocmds clear some other autocmd unexpectedly

Solution: clear it correctly
2025-10-10 21:09:51 -07:00
zeertzjq
9b03385d85 Merge pull request #36118 from janlazo/vim-8.2.5017
vim-patch:8.2.{2456,4772,5017}
2025-10-11 10:47:11 +08:00
Jan Edmund Lazo
ffdb316491 vim-patch:8.2.4772: old Coverity warning for not checking ftell() return value
Problem:    Old Coverity warning for not checking ftell() return value.
Solution:   Check return value of fseek() and ftell().

3df8f6e353

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-10-10 21:20:55 -04:00
Jan Edmund Lazo
7995e7a89b vim-patch:8.2.2456: Coverity warning for strcpy() into fixed size array
Problem:    Coverity warning for strcpy() into fixed size array.
Solution:   Add a type cast to hopefully silence the bogus warning.

7b6903f02c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-10-10 19:57:44 -04:00
glepnir
fafc329bbd feat(ui): 'pumborder' (popup menu border) #25541
Problem:
Popup menu cannot have a border.

Solution:
Support 'pumborder' option.
Generalize `win_redr_border` to `grid_redr_border`,
which redraws border for window grid and pum grid.
2025-10-10 07:14:50 -07:00
phanium
9c89212de1 fix(undotree): sync scroll pos with undo #36117
Problem: when undo in buffer, undotree window is not updated to
position of correct node

Solution: schedule nvim_win_set_cursor
2025-10-10 07:07:01 -07:00
luukvbaal
d8cea8d45d fix(ui2): don't scroll beyond eob in dialog window #36116
Problem:  Forward page scrolling reveals eob lines in the dialog window.
Solution: Check if the end of the buffer is visible before scrolling down.
2025-10-10 07:05:40 -07:00
Jan Edmund Lazo
eb67f3a6ba vim-patch:8.2.5017: gcc 12.1 warns for uninitialized variable
Problem:    Gcc 12.1 warns for uninitialized variable.
Solution:   Initialize the variable. (closes vim/vim#10476)

8be36eecdc

Co-authored-by: mityu <mityu.mail@gmail.com>
2025-10-10 00:33:47 -04:00
github-actions[bot]
56713ef872 docs: update version.c #35753
vim-patch:8.1.1989: the evalfunc.c file is still too big

vim-patch:8.2.0379: gcc warns for ambiguous else
vim-patch:8.2.0510: Coverity complains about using uninitialized variable
vim-patch:8.2.0566: Vim9: variable can be used uninitialized
vim-patch:8.2.1908: Lua is initialized even when not used
vim-patch:8.2.2313: Vim9: using uninitialized field when parsing range
vim-patch:8.2.2374: accessing uninitialized memory in test_undo
vim-patch:8.2.2509: tests fail on s390 build
vim-patch:8.2.2572: Vim9: crash when getting the types for a legacy function
vim-patch:8.2.3134: crash when using typename() on a function reference
vim-patch:8.2.3527: gcc complains about uninitialized variable
vim-patch:8.2.3653: terminal ANSI colors may be wrong
vim-patch:8.2.3755: Coverity warns for using a buffer in another scope
vim-patch:8.2.3770: new compiler warnings from clang-12 and clang-13
vim-patch:8.2.3875: gcc complains about buffer overrun
vim-patch:8.2.3893: Vim9: many local variables are initialized with an instruction
vim-patch:8.2.4017: gcc warns for misleading indent in Athena menu code
vim-patch:8.2.4023: using uninitialized variable
vim-patch:8.2.4126: crash on exit when built with dynamic Tcl
vim-patch:8.2.4468: Coverity warns for uninitialized struct member
vim-patch:8.2.4471: Coverity warns for uninitialized variable
vim-patch:8.2.4661: Coverity warning for using uninitialized variable
vim-patch:8.2.4779: lsan suppression is too version specific
vim-patch:8.2.4995: still a compiler warning for possibly uninitialized variable
vim-patch:8.2.5005: compiler warning for uninitialized variable
vim-patch:8.2.5068: gcc 12.1 warning when building tee
vim-patch:8.2.5069: various warnings from clang on MS-Windows
vim-patch:8.2.5073: clang on MS-Windows produces warnings
vim-patch:8.2.5075: clang gives an out of bounds warning
vim-patch:8.2.5085: gcc gives warning for signed/unsigned difference
vim-patch:8.2.5087: cannot build with clang on MS-Windows

vim-patch:9.0.0395: clang warnings for function prototypes
vim-patch:9.0.0860: MS-Windows: windres fails with clang 15.0.4
vim-patch:9.0.1088: clang warns for unused variable
vim-patch:9.0.1517: MacOS: configure removes -O2 from $CFLAGS
vim-patch:9.0.1685: silence Python 3.11 depreciations for gcc
vim-patch:9.0.1716: Windows build with python 3.12 and clang fails
vim-patch:9.0.1913: if_python: undefined behaviour for function pointers
vim-patch:9.0.1930: compiler warnings with clang-17
vim-patch:9.0.1971: macOS: FEAT_SOUND guard too restrictive

vim-patch:9.1.0066: gcc complains about use of uninitialized var
vim-patch:9.1.0067: gcc still complains about use of uninitialized var
vim-patch:9.1.0588: The maze program no longer compiles on newer clang
vim-patch:9.1.0827: CI: tests can be improved
vim-patch:9.1.0833: CI: recent ASAN changes do not work for indent tests
vim-patch:9.1.0846: debug symbols for xxd are not cleaned in Makefile
vim-patch:9.1.0884: gcc warns about uninitialized variable
vim-patch:9.1.0946: cross-compiling fails on osx-arm64
vim-patch:9.1.1189: if_python: build error due to incompatible pointer types
vim-patch:9.1.1347: small problems with gui_w32.c
vim-patch:9.1.1358: if_lua: compile warnings with gcc15
vim-patch:9.1.1365: MS-Windows: compile warnings and too many strlen() calls
vim-patch:9.1.1686: if_ruby: unknown pragma when not using gcc
vim-patch:9.1.1729: CI is not run with clang 21

vim-patch:9.1.1765: f_isnan() and f_isinf() do not correctly initialize rettv type
vim-patch:9.1.1767: Patch v9.1.1765 was wrong
vim-patch:9.1.1812: completion: flicker with slow LSPs
vim-patch:9.1.1814: Patch v9.1.1812 causes crashes
2025-10-09 20:30:22 -07:00
Vlad
abd0c882b3 fix(rpc): handle more cases when identifying loopback #36100
Problem:

On MacOS it is a relatively common pattern to set XDG_RUNTIME_DIR under
`/tmp` or `/var`. Both of these are symlinks to `/private/tmp` and
`/private/var`. When checking for loopback the input address is
normalized using `fix_fname`, however this is not applied to the
addresses of the sockets. As a result of one address being normalized
and the other not the comparison would fail.

Solution:

Normalize both sides of the comparison using `fix_fname`.
2025-10-09 18:04:02 -07:00
zeertzjq
b1c41a332d vim-patch:9.1.1843: tests: Test_search_stat_option() may fail on slow systems (#36110)
Problem:  tests: Test_search_stat_option() may fail on slow systems
Solution: test_search_stat: Extend searchcount() timeout if the test is
          being re-run due to flakiness (James McCoy).

closes: vim/vim#18524

4fa7ec8036

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-10-10 07:32:08 +08:00
zeertzjq
f81014f25c vim-patch:1388fa6: runtime(doc): Add reference to 'wildoptions' in fuzzy-matching docs
The docs for fuzzy matching seems to try to list every possible use
case, but misses this one. It's a good idea to be consistent.

closes: vim/vim#18525

1388fa62d2

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-10-10 07:21:09 +08:00
zeertzjq
ec8405c473 vim-patch:partial:7dba04f: runtime(doc,vim): Update base syntax, match full :syntime command
- Use the optional tail command-name spec at :help :syntime.
- Match full :syntime command and highlight args.

7dba04f15c

Documentation changes only.

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-10 07:21:09 +08:00
Mickaël RAYBAUD-ROIG
8e740db70c fix(vim.pack): skip checkout on bad version #36038
Refs: #36037
2025-10-09 13:40:26 -07:00
Mike J McGuirk
4598305e0b fix(undotree): mark title field annotation as optional (#36102)
* fix(undotree): mark title field annotation as optional

* fix(doc): run make doc for undotree annotation change
2025-10-09 10:49:49 -04:00
luukvbaal
ad8bce6674 fix(conceal): check for concealed lines on invalid row (#36084)
Problem:  May check for concealed lines on invalid line numbers.
Solution: Move checks after line number validation.
2025-10-09 15:44:11 +02:00
Tristan Kapous
645206e87f fix(undotree): error on undotree.open() with title as string #36085 2025-10-08 19:49:21 -07:00
Mike J McGuirk
81d2d88f70 feat(undotree): set 'filetype' #36091 2025-10-09 02:34:44 +00:00
zeertzjq
c401999e47 vim-patch:143686b: runtime(java): Fold adjacent "import" declarations (#36095)
Also, distinguish (by abbreviating their names) and manage
foldable kinds of syntax items: blocks of code ("b"), plain
comments ("c"), Javadoc comments ("d"), adjacent "import"
declarations ("i").  Fold all qualifying items by default;
otherwise, do not fold items of explicitly delisted kinds.
For example,
------------------------------------------------------------
	let g:java_ignore_folding = "bcdi"
------------------------------------------------------------

Resolves zzzyxwvut/java-vim#12.

closes: vim/vim#18492

143686b3c4

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-10-09 07:49:35 +08:00
zeertzjq
f21295d596 vim-patch:ec19075: runtime(doc): Normalise ellipsis dots in syntax.txt (#36094)
Use three dots rather than two.

closes: vim/vim#18521

ec19075f61

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-09 07:49:14 +08:00
zeertzjq
28355050a8 vim-patch:9.1.1839: Window may have wrong height if resized from another tabpage (#36093)
Problem:  Window may have wrong height if resized from another tabpage.
Solution: Improve check for whether a tabline has been added (zeertzjq).

fixes: vim/vim#18518
closes: vim/vim#18519

bd3b958027
2025-10-09 07:49:05 +08:00
zeertzjq
f09225e6dd Merge pull request #36096 from zeertzjq/vim-9.1.1834
vim-patch: Vim syntax updates
2025-10-09 07:48:27 +08:00
zeertzjq
6969534935 vim-patch:ce5f9f4: runtime(vim): Update base syntax, allow legacy script comments after :eval
closes: vim/vim#18522

ce5f9f45af

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-09 07:13:10 +08:00
zeertzjq
e47529ab56 vim-patch:9.1.1834: MS-Windows: not possible to highlight the title bar
Problem:  MS-Windows: not possible to highlight the title bar
Solution: Make the title/caption bar configurable by introducing the
          'go-C' option value which allows to highlight it using the
          TitleBar and TitleBarNC highlighting groups (Mao-Yining).

Introduce titlebar color customization for Windows 11 GUI through
highlight groups and new 'guioptions' flag:

- Add 'C' flag to enable titlebar color customization (opt-in)
- New highlight groups: TitleBar (active) and TitleBarNC (inactive)
- Uses DWMWA_CAPTION_COLOR and DWMWA_TEXT_COLOR DWM attributes
- Dynamically loads dwmapi.dll for Windows 11 compatibility
- Defaults to system colors when set to NONE or feature disabled

closes: vim/vim#18449

2c09368273

Co-authored-by: Mao-Yining <mao.yining@outlook.com>
2025-10-09 07:11:24 +08:00
dependabot[bot]
0ea46563eb ci: bump github/codeql-action from 3 to 4 (#36082)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-08 13:13:58 -07:00
Sean Dewar
d7472c0617 fix(api): nvim_open_win default to half-size for splits (#36088)
Problem: after #35601, nvim_open_win incorrectly attempts to set the size of a
split window to 0 if it wasn't specified.

Solution: only attempt to set the size again if it was actually specified. This has the effect of defaulting to half the size of the parent window (or it may be equalized with other windows to make room), like before.

Fix #36080
2025-10-08 16:22:29 +00:00
zeertzjq
c881bc537e vim-patch:9.1.1817: popup: there are some position logic bugs (#36075)
Problem:  popup: there are some position logic bugs
Solution: Refactor position logic and fix a few bugs
          (Girish Palya).

This change does the following:

- Simplified and rewrote horizontal positioning logic (was overly
  complex).
- Split horizontal and vertical positioning into separate functions.
- Fixed missing truncation marker (e.g. `>`) when items were truncated
  and `pummaxwidth` was not set.
- Fixed occasional extra space being added to menu items.
- Update tests

closes: vim/vim#18441

e3ed5584ed

Cherry-pick pum_display_{rtl,ltr}_text() changes from patch 9.1.1835.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-10-08 13:47:50 +08:00
Igor Lacerda
f67306cc67 fix(lsp): typos in method names #36077 2025-10-07 20:44:57 -07:00
zeertzjq
c58cc46094 vim-patch:f8b9251: runtime(doc): Fix typos in syntax.txt (#36073)
closes: vim/vim#18504

f8b9251d8f

Co-authored-by: Elijah Greenstein <197816462+elijahgreenstein@users.noreply.github.com>
2025-10-08 08:28:10 +08:00
zeertzjq
b9482a0a26 test: add a test for #36059 2025-10-08 08:16:17 +08:00