Commit Graph

9647 Commits

Author SHA1 Message Date
Maria Solano
382963891c fix(undotree): check foldmethod before invoking fold (#36192) 2025-10-14 21:59:25 -07:00
Mathias Fußenegger
cdc3702f8d revert "fix(lsp): _get_workspace_folders does not handle root_dir() function" #36183
This reverts commit 97ab24b9c7.

See discussion in https://github.com/neovim/neovim/pull/36071
2025-10-14 19:26:01 -07:00
Tomasz N
106cacc93b fix(pumblend): do not apply special highlight attrs from bg layer #36186
Problem: if pumblend >= 50, non-whitespace menu character gets italic,
bold, underline (or similar) attribute from the cell underneath, which
is not really useful and can't be "blended".

Solution: drop highlight combination for that special case (@zeertzjq
on #36133).

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-10-14 18:48:27 -07:00
Justin M. Keyes
bf4710d8c3 fix(lsp): "attempt to index nil config" #36189
Problem:
If a client doesn't have a config then an error may be thrown.
Probably caused by: 2f78ff816b

    Lua callback: …/lsp.lua:442: attempt to index local 'config' (a nil value)
    stack traceback:
            …/lsp.lua:442: in function 'can_start'
            …/lsp.lua:479: in function 'lsp_enable_callback'
            …/lsp.lua:566: in function <…/lsp.lua:565>

Solution:
Not all clients necessarily have configs.
- Handle `config=nil` in `can_start`.
- If user "enables" an invalid name that happens to match a *client*
  name, don't auto-detach the client.
2025-10-15 00:43:25 +00:00
zeertzjq
c8d6f3cf8a vim-patch:c95e143: runtime(doc): Miscellaneous documentation fixes (#36187)
- Use full option name for 'clipboard' at :help :put.
- Minor rewordings, typo fixes, and formatting fixes.

related: vim/vim#18453
closes: vim/vim#18572

c95e143819

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-14 23:09:25 +00:00
zeertzjq
c5d85646eb vim-patch:64c8105: runtime(rst): Preserve indentation of directives
This patch preserves indentation in comments.  It work by removing the
explicit 3-space indentation and replaces with with an expression which
uses the current value with a minimum of three spaces.

Discussed in the mailing list:

    https://groups.google.com/g/vim_dev/c/rn8ZLDrCbYU

Thanks to Friedrich Romstedt for reporting and Christian Brabandt for
investigating the issue.

closes: vim/vim#18566

64c8105867

Co-authored-by: Marshall Ward <marshall.ward@gmail.com>
2025-10-14 10:44:57 +08:00
zeertzjq
1ccbaa6c25 vim-patch:5ffb23c: runtime(rst): Update b:undo_ftplugin variable
The value of this variable is evaluated when the 'filetype' option is
changed and should be a command string that will undo any configuration
changes that the plugin has made.

See :help undo_indent for details

related: vim/vim#18566

5ffb23c967

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-14 10:44:47 +08:00
zeertzjq
6a6ba5c567 vim-patch:46d8697: runtime(rst): Style update
Minor style and whitespace changes to the reST syntax file, to sync with
the development branch.

related: vim/vim#18566

46d86979a9

Co-authored-by: Marshall Ward <marshall.ward@gmail.com>
2025-10-14 10:44:37 +08:00
zeertzjq
d6a9679b46 vim-patch:a70f346: runtime(rst): Enable spell checking for more syntax constructs
Enable spell checking for more recognised constructs:

* comments
* footnotes
* citations
* directives
* inline markup (*text*, **text**, ...)

related: vim/vim#18566

a70f346706

Co-authored-by: Kirk Roemer <91125534+kirk-roemer@users.noreply.github.com>
2025-10-14 10:44:28 +08:00
zeertzjq
263d0f86b4 vim-patch:d7fb4cd: runtime(rst): Inline literal escape support
Escape character support was disabled for inline literals, which are
handled separately from standard inline highlights, in that escape
characters are unsupported.

related: vim/vim#18566

d7fb4cd2f8

Co-authored-by: Marshall Ward <marshall.ward@gmail.com>
2025-10-14 10:44:20 +08:00
zeertzjq
08e29ec4a1 vim-patch:5485827: runtime(rst): Recognise numeric footnotes [1] correctly
The markup for footonotes [1] and citations [2] are almost identical.
The difference is that footnotes allow numeric values but citations
allow every valid reference name except numeric values.

The regex for matching citations currently only checks for valid
reference names but does not exclude number-only labels, thus also
matches numeric footnotes.  To match such footnotes, e.g. ``[1]`` define
the syntax rule for footnotes after the syntax rule for citations so it
gets higher precedence and matches first.

[1] https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#footnotes
[2] https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#citations

related: vim/vim#18566

5485827c5f

Co-authored-by: Kirk Roemer <91125534+kirk-roemer@users.noreply.github.com>
2025-10-14 10:44:09 +08:00
zeertzjq
2b2a297bf1 vim-patch:4e9f16d: runtime(rst): Correctly end nested comments
Previously, a comment in a directive block would incorrectly mark
all subsequent lines in the directive block as comment, because the
syn-region did not check the leading indent.

related: vim/vim#18566

4e9f16dd1e

Co-authored-by: Antony Lee <anntzer.lee@gmail.com>
2025-10-14 10:43:48 +08:00
zeertzjq
6b006a03c4 vim-patch:47949b4: runtime(rst): Fix highlights nested in directive body
The leading two dots of a RST directive gets matched by
rstExplicitMarkup group first, and then the directive name and directive
body will be matched by the groups contained in rstDirectives cluster in
order.

The rstExDirective group in rstDiretives matches any RST directives
other than footnote, citation and hyperlink target, therefore admonition
and code block will be matched by rstExDirective. This fix has
rstExDirective contain rstExplicitMarkup so as to enable recursive RST
directives match.

The interpreted texts enclosed in quotes are not highlighted within a
RST directive body, because the rstCruft cluster contains a non-existing
rstInterpretedText group.It should be renamed to
rstInterpretedTextOrHyperlinkReference which is defined in a
DefineInlineMarkup function call.

related: vim/vim#18566

47949b4b46

Co-authored-by: Minjie Xu <madjxatw@gmail.com>
2025-10-14 10:43:09 +08:00
zeertzjq
dbddd5989a vim-patch:310082f: runtime(rst): Add support for rst_minlines
Following the approach used in other syntax definitions, add support for
defining the "syntax sync minlines=..." values for rst files in the
users' ~/.vimrc files, to allow the users to adjust that value in case
syntax highlighting stops working for some of the files they edit.

related: vim/vim#18566

310082f3cf

Co-authored-by: Dragan Simic <dsimic@manjaro.org>
2025-10-14 10:42:43 +08:00
zeertzjq
7455c5ce88 vim-patch:0940465: runtime(rst): Fix doctest block syntax
A doctest block usually spans multiple lines, e.g.

>>> print('this is a Doctest block')
this is a Doctest block

Remove ``oneline`` argument to syntax region as this requirement is not
met.  Consequently, also remove ``display`` as the prerequisite (the
syntax region is on a single line) is no longer met.

----

Recognise '>>>' inside doctest blocks

Recognise subsequent '>>>' prompts in doctest blocks, e.g.

>>> print('this is a Doctest block')
this is a Doctest block
>>> print('this is a second Doctest block')
this is a second Doctest block
A doctest block usually spans multiple lines, e.g.

>>> print('this is a Doctest block')
this is a Doctest block

related: vim/vim#18566

0940465866

Co-authored-by: Kirk Roemer <91125534+kirk-roemer@users.noreply.github.com>
2025-10-14 10:41:58 +08:00
zeertzjq
fc74b9fb34 vim-patch:83eb1da: runtime(doc): Normalise formatting of builtin function descriptions (#36172)
- Column align tags
- Move tags to the same line as the function signature
- Move descriptions to the line below the function signature
- Add missing hyperlinks to builtins in the description text

closes: vim/vim#18478

83eb1da19e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-14 02:23:26 +00:00
zeertzjq
72578e5e28 vim-patch:5fe4faa: runtime(bitbake): fix multiline Python function parameter syntax (#36173)
Fix syntax highlighting for def-style Python functions, with their
parameters spanning multiple lines. E.g. the following should match as
valid Python code in Bitbake recipes:

    def myFunction(one, two, \
                   three, four):
        pass

For this to work, use the prefix modifier "\_" before the wildcard ".",
to also match newline characters.

closes: vim/vim#18565

5fe4faa711

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2025-10-14 02:17:24 +00:00
zeertzjq
c5ed5504f4 vim-patch:6ab4547: runtime(doc): fix inconsistent alignment (#36171)
closes: vim/vim#18562

6ab45471d4
2025-10-14 01:51:23 +00:00
zeertzjq
92b834fc7a vim-patch:9.1.1849: CTRL-F and CTRL-B don't work in more prompt
Problem:  CTRL-F and CTRL-B don't work in more prompt
Solution: Make CTRL-F and CTRL-B scroll by a screen down/up
          (Bjoern Foersterling)

closes: vim/vim#18545

fcf4c435af

Co-authored-by: bfoersterling <bjoern.foersterling@gmail.com>
2025-10-14 08:42:06 +08:00
Tomas Slusny
d590644620 fix(difftool): silence :only command in setup_layout #36168
Suppresses output from the :only command by passing the { silent = true }
modifier to vim.cmd.only(). This prevents unnecessary messages when
setting up the diff layout.

Closes #36167
2025-10-13 17:04:48 -07:00
Tomas Slusny
aaec3e5b0d fix(difftool): add check for window number when cleaning up layout #36161
- Move autocmd cleanup logic back to setup_layout as WinClosed autocmds
  were triggering for every closed window even when buf scoped, and when
  buf scoped, pattern filter did not work.
- Cleanup when quickfix window is closed as well to prevent state where
  on closing quickfix setup_layout will reset it after with empty
  content because of WinClosed autocmds triggering.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2025-10-13 11:12:42 -07:00
Yochem van Rosmalen
25322a3a3b fix(help): only set url for help files in $VIMRUNTIME #36165
Problem:
Checking if the tag is nvim-owned (defined in a $VIMRUNTIME/doc/*.txt
file) is too expensive for now without non-obvious workarounds

Solution:
Only set url extmarks for $VIMRUNTIME/doc/*.txt files.

Closes: #36163
2025-10-13 11:08:37 -07:00
zeertzjq
a65202e6bd vim-patch:partial:c58f91c: runtime(doc): Whitespace updates (#36160)
Use double sentence spacing and wrap lines at 'textwidth'.  Code
examples and tables were not wrapped unless this had already been done
locally.

closes: vim/vim#18453

c58f91c035

Fix incorrect docs in :h ModeChanged.
Cherry-pick :h bufnr() changes from patch 8.1.2080.

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-10-13 08:53:21 +00:00
zeertzjq
446161ae08 vim-patch:2a33b49: runtime(make): syntax highlighting update for makeDefine (#36158)
Previously contents in makeDefine are nearly highlighted as Define, so
comments and targets shares the same color as Define, making it hard to
distinguish if someone write large block of targets-recipes as defined
function.

Such scenario is common in building data analysis pipeline. Recipes are
reused and targets may have multiple variables, and a single % implicit
rule is not enough.

closes: vim/vim#18403

2a33b499a3

Co-authored-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
2025-10-13 08:57:59 +08:00
zeertzjq
83c7193c11 vim-patch:9.1.1850: completion: not triggered after i_Ctrl-W/i_Ctrl-U (#36156)
Problem:  completion: not triggered after i_Ctrl-W/i_Ctrl-U
Solution: Trigger autocomplete when entering Insert mode
          (Girish Palya).

fixes: vim/vim#18535
closes: vim/vim#18543

da2dabc6f7

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-10-13 00:08:53 +00:00
zeertzjq
b0edab3631 vim-patch:40dec46: runtime(doc): Replace rotted URL links (#36151)
Both links to libXpm and mysyntax.vim are up but the listed
libXpm version is not offered anymore and mysyntax.vim is no
longer served at all.  The link for searching dictionary
extensions of Apache OpenOffice is broken; an alternative
link can be discovered from the home page.  Finally, the
English dictionaries Apache OpenOffice extension is probably
gone for good (is it incompatible with more recent versions
of the suite?) as its page neither available directly nor
discoverable through search.

closes: 18549

40dec4609d

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-10-13 07:24:58 +08:00
zeertzjq
398c861daf vim-patch:37c8ce7: runtime(cangjie): Fixes and improvements for syntax script (#36150)
Housekeeping:
- Add GitHub repository link
- Update Last Change date

Style:
- Add Vim modeline for consistent formatting
- Unify indentation style (spaces to tabs)
- Wrap long cluster definitions for readability

New Features:
- Add highlighting for escape sequences
- Add error highlighting for invalid rune literals
- Add syntax-based folding support

Fixes:
- Fix rune matching to allow only a single character/escape
- Fix highlighting for double-quoted rune literals
- Fix highlighting for floats with exponents and type suffixes

37c8ce7fac

Co-authored-by: Wu Junkai <wujunkai20041123@outlook.com>
Co-authored-by: dkearns <dougkearns@gmail.com>
2025-10-13 07:24:45 +08:00
Yochem van Rosmalen
62d3a2110d fix(help): wrong tag url in third-party help docs #36115
fix(help): only set url for nvim-owned tags

Problem:
1. gx on |nonexistingtag| opens
https://neovim.io/doc/user/helptag.html?nonexistingtag.
2. b:undo_ftplugin doesn't remove url extmarks.

Solution:
1. Check if the tag is defined in a help file in $VIMRUNTIME.
2. Solution: clear namespace for buffer in b:undo_ftplugin.
2025-10-12 15:08:18 -07:00
Tomas Slusny
c6113da5a9 fix(difftool): fully resolve symlinks when comparing paths #36147
Fixes issue on mac where it was constantly reloading buffers as paths
were not being normalized and resolved correctly (in relation to buffer
name).

Quickfix entry:
/var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue

Buffer name:
/private/var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue

/var was synlinked to /private/var and this was not being properly
handled.

Also added lazy redraw to avoid too many redraws when this happens in
future and added test for symlink handling.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2025-10-12 18:25:14 +00:00
Tomas Slusny
c9b74f8b7e fix(difftool): ensure split layout, use systemlist #36145
- Always open the right window to the right, regardless of 'splitright'
  setting, ensuring the left window is always leftmost.
- Use `vim.fn.systemlist` for diffr output to avoid manual splitting.
- Add a test to verify window layout consistency with 'splitright' and
  'nosplitright' options.
- Escape quotes in git difftool example properly.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2025-10-12 05:11:27 +00:00
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
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
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
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
Till Bungert
28157738e3 fix: vim.lsp.omnifunc should not throw away other items #35346 2025-10-11 12:42:14 -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
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
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
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
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