Commit Graph

11211 Commits

Author SHA1 Message Date
Milad Rashidikhah
20ff82d9fc fix(treesitter): clamp unbounded fold ranges
Problem:
Tree-sitter uses UINT32_MAX for full-document ranges, which becomes -1 on 32-bit platforms and reaches _foldupdate as an invalid end row.

Solution:
Treat negative changed-range end rows as unbounded and clamp them to the buffer line count. Add a regression test that simulates the 32-bit sentinel.

AI-assisted: Codex
2026-07-28 11:00:30 +02:00
Barrett Ruth
e3c5974adf feat(dir): open cwd with 1- #40948 2026-07-27 18:30:54 -04:00
Justin M. Keyes
fbcb7a056c feat(exmode): "1q:", :exmode #41010
Problem:
Want `gQ` for _le multicursor_.

Solution:
- Don't use `gQ` for exmode.
- Introduce `:exmode`.
- Introduce `[count]q:` as an alias to `:exmode`.
2026-07-27 11:12:47 -04:00
Josh Hirschkorn
97a71ab484 fix(man): use direct lookup without manpath #40421
Problem:
On NetBSD, `man -w open` can return the exact manpage path, but `:Man`
may still fail when man directories cannot be discovered from `manpath
-q`, bare `man -w`, or `$MANPATH`.

Solution:
Fall back to the direct manpage lookup when directory discovery fails.
Add a test for resolving `open(2)` through `goto_tag()` without manpath
data.
2026-07-27 13:20:46 +00:00
Justin M. Keyes
80cd482577 fix(lua): vim.regex():match_str abort in Luv callback #41008 2026-07-27 11:01:54 +00:00
Justin M. Keyes
359459dec6 refactor(exmode): Ex-mode as cmdwin + Lua #40991
Problem:
POSIX-compatible Ex-mode requires special-cases all over the codebase to
match various quirks that don't actually matter to users.
- The main utility of *interactive* Ex-mode is its REPL behavior, and
  that can be achieved with `cmdwin`, which also gains extra UX
  benefits.
- The main utility of *non-interactive* `nvim -es` is for shell
  scripting, where Ex-mode quirks are mostly unhelpful (e.g. the
  "Entering Ex mode" message).

Solution:
- Reimplement *interactive* Ex-mode as a "persistent, insert-mode
  cmdwin" in Lua.
  - "nvim -e/-E" is simply an alias to "gQ".
- Reframe *non-interactive* Ex-mode (`nvim -es`) as "script mode".
  - Drop POSIX Ex-mode quirks.

Improvements:
- "nvim -V1 -es" output ends with a final newline!
- "nvim -V1 -es" no longer shows the "Entering Ex mode" msg. (This was
  pointless noise, unwanted for scripting purposes.)
- stdin is no longer typeahead. Scripts (":lua io.read()") can read
  stdin as data.
- Empty line is a no-op: a stray blank line no longer moves the cursor
  (deviates from POSIX ex "+1"), no longer exits 1 at EOF (E501).

Preserved behavior:
- cursor starts at "$"
- mode()=="cv" (for non-interactive)
- multiline commands (:append/:function/heredoc pull continuation lines)
- bare-range print
- :print=>stdout
- -V1=>stderr
- CRLF input
- continue-after-error and exit codes

Dropped (regressed) POSIX behavior (non-interactive):
- Event loop only ticks while/between commands, not while blocked
  waiting for a stdin line.
- ":g/pat/visual...Q"
- input()/getchar()/":s/x/y/c" no longer consume stdin lines as
  answers: Nvim stops at end-of-input, skipping the rest of the script,
  exit 0. Use ":lua io.read()" instead.
  - If users care about this they should use interactive Ex-mode (`gQ`).
- ":@r" stops at end of the register instead of continuing to read
  cmdline input from stdin.
2026-07-27 06:25:21 -04:00
zeertzjq
1c83e43f27 vim-patch:916809a: runtime(python): highlight the 'lazy' soft keyword
Lazy imports (PEP 810, to be released in Python 3.15) introduces a
`lazy` soft keyword that's recognized when it precedes a `from` or
`import` keyword.

closes: vim/vim#20342

916809ae1e

Co-authored-by: Jon Parise <jon@indelible.org>
2026-07-27 06:31:58 +08:00
zeertzjq
1d36cf1dbe vim-patch:f88e719: runtime(python): Fix indenting for brackets within python byte strings
Problem:  s:SearchBracket()'s skip-expression matches syntax group
          names ending in "Comment", "Todo", or "String" to decide
          whether a candidate bracket is inside a string/comment
          and should be skipped for indentation purposes. Byte and
          raw-byte string literals (b"...", rb"...") are highlighted
          via the pythonBytes/pythonRawBytes syntax groups, which
          don't end in "String", so brackets inside them (e.g.
          b"[") were never skipped and were counted as real,
          unmatched brackets, producing incorrect indentation.

Solution: Add "Bytes" to the indent script's existing suffix match,
          so pythonBytes/pythonRawBytes are recognized directly, the
          same way pythonString/pythonFString/pythonRawString
          already are.

          This supersedes an earlier version of this fix that
          renamed pythonBytes/pythonRawBytes to
          pythonBytesString/pythonRawBytesString in
          runtime/syntax/python.vim.

fixes:  vim/vim#20812
closes: vim/vim#20827

f88e7191da

Co-authored-by: qwavies <qwavsbusiness@gmail.com>
2026-07-27 06:31:40 +08:00
zeertzjq
ef93e93958 vim-patch:4e3df44: runtime(indent-tests): Annotate timed "search*()"es for tracing
related: vim/vim#17116

4e3df44aa2

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2026-07-27 06:31:33 +08:00
Rob Pilling
c57818bb43 fix(ui2): avoid flickering fileinfo messages #41002
## Flicker cause

ui2's `check_targets()` function creates the hidden ui2 windows with this call chain:
```
nvim_open_win()
win_set_buf()
do_buffer()
set_curbuf()
enter_buffer()
```

and `enter_buffer()` sets `need_fileinfo`:

fdc09be03c/src/nvim/buffer.c (L1837-L1839)

This is then picked up by `normal_redraw`:

fdc09be03c/src/nvim/normal.c (L1381-L1385)

The fileinfo message then causes a ui2 window to appear to display it:

fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L325-L330)

... which ends up calling `set_pos`, which registers an `on_key` handler:

fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L726-L728)

This handler closes the ui2 window when the user presses, for example, `l` (because the user's not focusing said window).
The handler eventually calls `check_targets()`:

fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L594-L595)

and `check_targets()` takes us back to the beginning, causing the ui2 window flicker

## Repro

```vim
=require("vim._core.ui2").enable()
set ch=0 shm-=F ve=all
e /tmp/x
```

Then hit `Ctrl-G` to show fileinfo (if not already shown) and hold `l`

## Fix

Effectively surround the ui2 window creating with `:silent`
2026-07-26 17:40:06 -04:00
Artem Krinitsyn
fdc09be03c fix(help): g==: 'No code block found' #40990
Problem:
The code block query relied on a bug fixed in commit
7ed5609439, where a trailing newline was
not included in a node's text.

Solution:
Fix the query to expect the newline.
2026-07-26 12:27:30 -04:00
Artem Krinitsyn
dec3d8215d fix(text): indent() ignores expandtab when indent unchanged #40932
Problem:
After expanding tabs with the `expandtab` option, if the old indent
matches the requested one, `vim.text.indent()` returns the input
unchanged.
The optimization path assumes that if old_indent == size, the input
wouldn't be changed, which is not correct when old_indent is formed by
expanded tabs.

Solution:
Apply the optimization only when `expandtab` is not set.
2026-07-26 06:24:39 -04:00
Justin M. Keyes
6539bd6602 Merge #40910 from barrettruth/fix/dir-literal-env-paths 2026-07-26 06:11:01 -04:00
zeertzjq
11cad372ef vim-patch:fb1a2e9: runtime(sh): fix Bash/Ksh array highlighting after an escaped paren
fixes:  vim/vim#18712
closes: vim/vim#20705

fb1a2e9d13

Co-authored-by: frapank <francesco.pankov+github@proton.me>
2026-07-26 09:02:02 +08:00
zeertzjq
43b666cb27 vim-patch:770eb7d: runtime(doc): clarify expandcmd() and "~" behaviour
fixes: vim/vim#20793

770eb7db17

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-07-26 09:01:32 +08:00
zeertzjq
a7bab6121b vim-patch:e2d3e78: runtime(doc): remove incorrect note about spellcapcheck and the first word
'spellcapcheck' checks the first word in the file for a capital like any
sentence start: capcol is seeded to 0 for line 1 in spell_check_sblock().

This has been the case since the feature was added in v7.0100, so the note
that it "doesn't work for the first word in the file" is incorrect.

related: f9184a1d3151b5b727fec86c2ac0946c9c68df4d (code change)
related: 0d9c26dd8333aae4b20015f13fe2e8e1f07037bd (initial doc patch,
         just a few minutes later)
related: vim/vim#20715

e2d3e7818b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-07-26 09:00:30 +08:00
Barrett Ruth
1594ca2368 fix(dir): preserve environment variables in paths 2026-07-25 18:02:55 -05:00
Barrett Ruth
ac4e5460b1 feat(vim.fs): dir(opts.normalize) 2026-07-25 18:02:55 -05:00
Barrett Ruth
22d44ef875 fix(api): add lhs option for keymap deletion 2026-07-25 10:36:56 -07:00
Justin M. Keyes
715d8887ec docs: misc #40847
Co-authored-by: Barrett Ruth <br@barrettruth.com>
Co-authored-by: Nathan Zeng <nathan.j.zeng@gmail.com>
2026-07-25 12:47:51 -04:00
Barrett Ruth
4975a186f2 fix(dir): :browse edit opens dir browser #40930
Problem: `:browse edit` (and variants) without an argument fails instead
of opening a browser.

Solution: Dispatch to dir.lua using the cwd as the implied directory.
Replace the inherited GUI-only documentation with the supported
behavior. Support vsplit, split, tabedit variants.
2026-07-25 06:56:52 -04:00
zeertzjq
63c84e4c1a vim-patch:9.2.0848: tagfunc "cmd" with a generic Ex command corrupts the tag entry (#40951)
Problem:  When a tagfunc returns a "cmd" that is neither a line number nor
          a search pattern, the tag entry is corrupted: the "kind" field is
          lost and taglist() returns a mangled "cmd".
Solution: Accept any Ex command in "cmd" as in a tags file, terminate a
          generic command with a bar so the trailing fields are preserved,
          and reject a value that cannot be stored in a tag line with E987
          (Hirohito Higashi).

fixes:   vim/vim#20781
related: vim/vim#20790
closes:  vim/vim#20828

86adef19fc

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Mao-Yining <mao.yining@outlook.com>
2026-07-25 07:07:22 +08:00
zeertzjq
db41e4c74f vim-patch:0c1a214: runtime(doc): Fix truncated sentence in :h map()
fixes: vim/vim#20725

0c1a214497

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-07-25 06:32:03 +08:00
zeertzjq
19c89b6d68 vim-patch:9.2.0849: filetype: osquery config files are not recognized
Problem:  filetype: osquery config files are not recognized.
Solution: Detect osquery.conf as jsonc filetype (Fionn Fitzmaurice).

Reference:
https://osquery.readthedocs.io/en/stable/deployment/configuration/#configuration-components

closes: vim/vim#20826

ea183ce4e5

Co-authored-by: Fionn Fitzmaurice <fionn@github.com>
2026-07-25 06:29:04 +08:00
zeertzjq
2fb28fdcb6 vim-patch:e298a57: runtime(iar): Add iar compiler plugin
closes: vim/vim#20830

e298a57353

Co-authored-by: Andrey Starodoubtsev <andrey.starodoubtsev@gehealthcare.com>
2026-07-25 06:26:55 +08:00
zeertzjq
77b0476f40 vim-patch:e9234b9: runtime(go): update Go syntax file
Update the Go syntax file with some recent changes made to vim-go to
correctly highlight the second and later lines of concatenated strings
in var or const blocks.

closes: vim/vim#20835

e9234b9b4a

Co-authored-by: Billie Cleek <bhcleek@gmail.com>
2026-07-25 06:26:41 +08:00
zeertzjq
72b2c713ea vim-patch:9.2.0845: [security]: arbitrary Ex command execution during C omni-completion
Problem:  [security]: arbitrary Ex command execution during C
          omni-completion (Threonine)
Solution: Match tags typeref literally to block Ex command injection
          (Yasuhiro Matsumoto).

Escaping only "/" and "\" left the typeref able to break out of the
:vimgrep pattern without a "/": an unclosed "[" makes vimgrep's pattern
skipping fail, and the parser then treats a following "|" as a command
separator, so the tag value runs as Ex commands during C omni-completion.
Match the field literally with \V so no regex metacharacter can affect
pattern parsing.

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-cx73-phcg-3j5g

2f628d8104

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-07-25 06:23:13 +08:00
Olivia Kinnear
bb104ba4db feat(health): improvements to :checkhealth #40935
Changes:
- Removed the blank line before the first healthcheck header.
- Fixed a bug where the entire "Terminal" section of `vim.health` would
  not appear if the `infocmp` executable was not found.
- Fixed a typo in `vim.lsp` when displaying the LSP log level.
2026-07-24 11:54:12 -04:00
Justin M. Keyes
f8cfd7f06a feat(options): schema, "dict" options, messages
Problem:
Options parsing is still painful for dict-style options.

Solution:
schema-maxxing => better `opt:get()` (will be the basis for `vim.o()`),
unified (and more-detailed) err msgs.

- Drop bespoke structure-builder in `_core/options.lua`.
- Define `schema` for all non-primitive options (except 'guicursor' and
  statusline-style options); generate reified keysets `OptKeyDict`).
  - Generate 'fillchars' => `fcs_tab`, 'listchars' => `lcs_tab`.
- `nvim_set_option_value`:
  - Return the improved structures. Also from `vim.opt.x:get()`.
  - Eliminate api <=> lua roundtrip, centralize option structure
    handling.
- Improve/unify errors.
  - Bump ERR_BUFLEN 80 → 256 so the "one of" list isn't truncated.
- Eliminate old 'diffopt' order-dependence (`iwhiteall` before `iwhite`)

Error samples:

    Typed-key path (opt_strings_check → diffopt/mousescroll/breakindentopt):
    E474: Unknown item 'foo'
    E474: 'context' requires a number
    E474: 'ver' number is out of range
    E474: 'algorithm' must be one of: myers, minimal, patience, histogram
    E474: 'filler' does not take a value

Related:

- #31084
- #34661
- #31820
- #14739
- #20107
- fix #18875
  - :get() returns `{ sbr = true, shift = '3' }` (reified-keyset) instead of `{'sbr', 'shift:3'}`
  - Setting via table now works too. `object_as_optval_for` `is_map` now recognizes struct options.
- fix #30296
  - instead of `E474: Invalid argument`, errors now look like:
    ```
    E474: Invalid value 'x', expected one of: single, double: ambiwidth=x
    E474: Unknown item 'foo': diffopt=foo
    E474: 'context' requires a number: diffopt=context:x
    ```

simplify `win_float_parse_option` from #26799.
2026-07-24 13:05:20 +02:00
Barrett Ruth
5d76b9836a feat(dir): support counts for parent navigation #40927 2026-07-24 06:48:47 -04:00
Barrett Ruth
ce9cc43f23 fix(dir): open CWD from unnamed buffer with - mapping #40926 2026-07-24 06:45:13 -04:00
Maria Solano
66441e549d fix(text): validate opts.expandtab in vim.text.indent() #40936 2026-07-24 03:52:19 -04:00
zeertzjq
8d1f8d8dc3 vim-patch:9.2.0840: [security]: code injection in netrw via bookmarks
Problem:  [security]: code injection in netrw via bookmarks and history
          (David Carliez)
Solution: Escape the '|' explicitly (Yasuhiro Matsumoto)

The bookmark and history menu builders interpolate paths into :execute'd
:menu commands using g:netrw_menu_escape, which did not escape the Ex
command separator '|'. A crafted path could break out of the :menu command
and run arbitrary Ex/shell commands when the menu was built or triggered.

Add '|' to g:netrw_menu_escape for the menu names, escape the :e right-hand
side with fnameescape(), and quote the netrw#MakeTgt() argument with
string() instead of raw single-quote interpolation.

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-rcr7-f3wr-22r2

29c6fd090d

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-07-24 08:14:20 +08:00
zeertzjq
0a8d881537 vim-patch:9.2.0839: [security]: arbitrary code execution via keyword lookup
Problem:  [security]: arbitrary code execution via keyword lookup in
          sh.vim, zsh.vim and ps1.vim filetype plugin
          (manus-use)
Solution: For powershell, quote the commands using single quotes, for
          sh/zsh pass the argument as a separate list item to term_start()/system()
          (Yasuhiro Matsumoto).

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-r5v6-q6j8-8qw2

c5a82fe013

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-07-24 08:14:04 +08:00
glepnir
f95bd73935 feat(float): 'previewpopup' option #26799
Problem:
The preview-window (:pedit, etc.) always uses a split, but it would be
useful as a floatwin (or "popup").

Solution:
Support Vim's 'previewpopup' option.
2026-07-23 17:27:14 -04:00
zeertzjq
b81c60c3fa vim-patch:9.2.0830: the completion menu is not used on terminals without colors (#40917)
Problem:  When the terminal reports no colors ("t_Co" is 0 or 1) the
          insert mode completion popup menu is not shown at all, while
          the command line completion popup menu ('wildoptions' contains
          "pum") is shown.  In 'wildmenu' completion the current match
          cannot be told apart from the other matches (Maxim Kim)
Solution: Show the insert mode completion popup menu regardless of the
          number of colors and add "term" attributes to the default
          highlighting of Pmenu, PmenuSel and PmenuThumb.  The wildmenu
          is drawn with the attributes of the status line, which is
          reversed, and on most terminals the standout mode is the same
          as the reverse mode, thus use the underline mode for the
          default highlighting of WildMenu (Hirohito Higashi).

fixes:  vim/vim#20800
closes: vim/vim#20803

52485e0d24

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 07:40:11 +00:00
zeertzjq
05c5cf7e40 vim-patch:9.2.0836: filetype: .git-blame-ignore-revs file is not recognized (#40912)
Problem:  filetype: .git-blame-ignore-revs file is not recognized
Solution: Detect .git-blame-ignore-revs file as gitrevlist filetype,
          include syntax and filetype plugins (Fionn Fitzmaurice)

A Git revision list is

> a list of object names (i.e. one unabbreviated SHA-1 per line)...,
> comments (#), empty lines, and any leading and trailing whitespace are
> ignored.

(from Git's fsck.skipList documentation).

The default output of git rev-list will match this. It is also suitable
as input to git blame --ignore-revs-file.

This adds filetype detection matching .git-blame-ignore-revs files,
syntax highlighting and basic filetype settings.

closes: vim/vim#20702

a8d5be9284

Co-authored-by: Fionn Fitzmaurice <fionn@github.com>
2026-07-23 09:03:07 +08:00
zeertzjq
6ecf226e44 vim-patch:6e46829: runtime(netrw): fix E471 in Neovim when g:netrw_chgwin is one past the last window (#40911)
Problem:  Opening a file from a netrw listing throws
          "E471: Argument required: keepj keepalt 2wincmd 1" when
          g:netrw_chgwin equals winnr('$')+1, e.g. after opening
          :Lexplore (which sets g:netrw_chgwin=2) and closing the
          sidebar, then browsing with :Explore in the remaining window.
          s:NetrwBrowseChgDir builds the window jump as
          "g:netrw_chgwin wincmd curwin", passing the saved window
          NUMBER where wincmd expects its single-letter argument.
Solution: Jump back to the saved window with "curwin wincmd w", as the
          surrounding comment intends; the following statement then
          performs the actual jump to g:netrw_chgwin.

The faulty line dates back to at least Vim 9.0
(runtime/autoload/netrw.vim:4976 at v9.0.0000).

Reported (against the since-archived netrw repo) in
saccarosium/netrw.vim#98 and neovim/neovim#34169.

Note: no test, because the error reproduces only in Neovim.

closes: vim/vim#20741

6e46829991

Co-authored-by: erdivartanovich <erdivartanovich@gmail.com>
2026-07-22 23:28:05 +00:00
Barrett Ruth
ada2007453 feat(dir): provider framework #40738
Problem:
The core behaviors of `nvim.dir` cannot be reused by consumers
such as the archive plugin, ssh browser, etc.

Solution:
- Define a basic "provider" shape.
- Extract the filesystem provider.
2026-07-22 13:21:39 -04:00
Barrett Ruth
fe6c1cb4bd fix(treesitter): queries for bundled diff parser #40866 2026-07-22 12:03:34 -04:00
phanium
526365a8d1 fix(help): handle escape edge cases #40901
* fix(help): preserve multi-letter CTRL modifiers in :help subject

Problem: After PR 39537 normalized `CTRL-U-default` by excluding
`-` from the trigger char class, the regex `(CTRL%-[^{])([^-_\\])`
also fires between `CTRL-S` and the `H` of the `SHIFT` modifier
in tags like `c_CTRL-SHIFT-V`, splitting it into the non-existent
`c_CTRL-S_HIFT-V`.

Solution: Exclude uppercase letters from the char class so a
multi-letter modifier following `CTRL-X` (e.g. `SHIFT`, `ALT`) is
no longer split. The `-` exclusion from 39537 is preserved so
`i_CTRL-U-default` still works.

* fix(help): escape ~ in expr-=~? exception to keep regex valid

Problem: The `expr-=~?` exception in the tag alias table maps to
`=~?`, but in Vim's regex engine `~` refers to the previous
substitute pattern. With no prior substitute the pattern fails to
compile, so `:help expr-=~?` returns E149 even though the tag exists.

Solution: Escape `~` as \\\~` so the alias expands to a valid
regex (`=\\\~?`) that substring-matches the `expr-=~?` tag. Other
`expr-X?` entries are unaffected since they don't contain `~`.

* fix(help): don't insert _ before CTRL- when preceded by -

Problem: The rule `([^_])CTRL%- -> %1_CTRL-` inserts an underscore
between any non-underscore char and `CTRL-`, which wrongly rewrites
tags like `map-CTRL-C` and `telnet-CTRL-]` (where `CTRL-` is
literal text in the tag, not a key chord).

Solution: Exclude `-` from the trigger char class so a hyphen
immediately before `CTRL-` is preserved. The existing behavior for
`iCTRL-GCTRL-J` -> `i_CTRL-G_CTRL-J` is unaffected because the
`G` before `CTRL-J` is not `-`.

* fix(help): only treat ^X as caret notation for valid control chars

Problem: The regex `%^([^_])` converts any `^X` to `CTRL-X`,
including `:set^=` where `^=` is literal text in the tag, not a
caret-notation control character.

Solution: Restrict the transformation to caret-notation chars
(`%a` or one of `?@[\\]^{}`). This matches the C reference
behavior where `^X` is only converted when X is alphanumeric or one
of the control-notation punctuation chars. `{` is retained so
`^{char}` still maps to the `CTRL-{char}` placeholder tag.
2026-07-22 07:26:09 -04:00
zeertzjq
a277c08d98 vim-patch:9.2.0821: filetype: msmtp system-wide rc file not detected (#40895)
Problem:  filetype: msmtp system-wide rc file not detected (chdiza).
Solution: Detect 'msmtprc' as filetype msmtp, like '.msmtprc'
          (Doug Kearns).

fixes:  vim/vim#20751
closes: vim/vim#20752

88440f9a34

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-07-21 23:16:33 +00:00
Artem Krinitsyn
9180c6e093 fix(lsp): guard linked_editing_range refresh on attach (#40888)
Problem:
on_attach() calls refresh(), but there is no guarantee the attached
buffer is the current buffer. This can make linked editing request
handling assume the wrong window.

Solution:
Call refresh() only if the current buffer is attached. This keeps the
initial highlighting behavior while avoiding making incorrect request.
2026-07-21 10:32:13 -07:00
Sanzhar Kuandyk
a87e91677c fix(system): use native path for Windows executables #40885
Problem:
When 'shellslash' is set, exepath() returns forward-slashed paths.
Passing that path to vim.system() can prevent cmd.exe from launching.

Solution:
Convert the resolved executable path to native separators before spawning.
Add a Windows regression test for cmd.exe with 'shellslash' enabled.
2026-07-21 07:58:44 -04:00
zeertzjq
69e1321731 vim-patch:203210e: runtime(zathurarc): sync options with latest zathura master (#40879)
closes: vim/vim#20733

203210e48b

Co-authored-by: Jian-Shuo Huang <jianshuo.huang@tuta.io>
2026-07-21 07:37:14 +08:00
Barrett Ruth
16c145d240 fix(ui2): preserve Visual mode messages #40828
Problem:
The existing `showmode` overlay can immediately cover messages emitted while
Visual mode is active, including the `g CTRL-G` word count.

Solution:
Protect Visual mode messages with the existing message delay and temporarily
hide the previous last-line overlay until it is restored.
2026-07-20 15:44:37 -04:00
Barrett Ruth
d343a1e230 fix(ui2): position message windows without autocmds (#40867)
Problem:  Fix applied in b2bb60d7 does not properly replace the normal command.
Solution: Restore normal command with `noautocmd` to resolve #40780.
2026-07-20 19:58:30 +02:00
Justin M. Keyes
317c5ddda6 fix(lsp): incorrect rendering of markdown codeblock #40861
Problem:
LSP hover erroneously drops blank lines before a 4-space-indented
codeblock, which is not valid Markdown. This causes incorrect parsing
and wrong display.

Solution:
Fix `split_lines` so that it doesn't drop the blank line just before
a 4-space-indented codeblock.

fix https://github.com/neovim/neovim/issues/40860
2026-07-20 10:03:11 -04:00
PinkLea
a56b74bde3 feat(lua): Iter:count() #40831 2026-07-20 09:53:06 -04:00
penglei
84fd9214cc fix(diagnostic): skip out-of-range lnum in underline handler #40839
Problem:
`vim.diagnostic.handlers.underline.show` throws `E565: Index out of bounds` when
it tries to underline a diagnostic whose `lnum` is past the end of the buffer.
This happens with stale diagnostics set on an unloaded buffer (e.g. via
`bufadd()`) that are drawn only after the buffer is loaded: by then the file on
disk can be shorter than the `lnum` the diagnostic carried. File pickers
(snacks.nvim) that open files via `bufadd` + `:buffer` hit this whenever an LSP
server has already emitted diagnostics for that URI.


Solution:
Skip diagnostics with an out-of-range `lnum` in the underline handler.

Other handlers `M.virtual_text.show()`, `M.signs.show()`, have a similar condition.
2026-07-20 06:59:21 -04:00