Commit Graph
55 Commits
Author SHA1 Message Date
61e71ccf8a docs: misc (#42570)
Close #41553
Close #41912
Close #41962
Close #42354
Close #42569

Co-authored-by: Nathan Smith <nathan@nathansmith.io>
Co-authored-by: Eman Resu <elevenaka11@gmail.com>
Co-authored-by: Maria Solano <majosolano99@gmail.com>
Co-authored-by: Nagato Yuzuru <nagato@yuzuru.me>
Co-authored-by: stevenhanwen <stevenhanwen.kang@outlook.com>
2026-10-28 02:10:42 +00:00
Justin M. Keyes b83273aefd docs: flow layout
Work towards enabling "flow" layout in most `:help` files.

Since [tables are supported in help](https://github.com/neovim/tree-sitter-vimdoc#tables),
it's now possible to render most help files as ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88)
instead of the legacy fixed-width layout. Besides [improved HTML rendering](https://github.com/neovim/neovim/pull/42381#discussion_r4285705739),
flow layout will allow `:help` presentation-mode to un-hardwrap text
blocks.
2026-10-16 19:02:23 +02:00
Justin M. Keyes d65f9daf45 docs: cleanup invalid help source
Work towards enabling "flow" layout in most `:help` files.

Since [tables are supported in help](https://github.com/neovim/tree-sitter-vimdoc#tables),
it's now possible to render most help files as ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88)
instead of the legacy fixed-width layout. Besides [improved HTML rendering](https://github.com/neovim/neovim/pull/42381#discussion_r4285705739),
flow layout will allow `:help` presentation-mode to un-hardwrap text
blocks.
2026-10-16 19:02:23 +02:00
Justin M. Keyes ca05480e0d docs: cleanup #42395
Work towards enabling "flow" layout in most `:help` files.

Since [tables are supported in
help](https://github.com/neovim/tree-sitter-vimdoc#tables), it's now possible to
render most help files as ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88)
instead of the legacy fixed-width layout. Besides [improved HTML rendering](https://github.com/neovim/neovim/pull/42381#discussion_r4285705739),
flow layout will allow `:help` presentation-mode to un-hardwrap text blocks.
https://github.com/neovim/neovim/issues/31825
2026-10-16 10:23:33 -04:00
Justin M. Keyes 45f83c70ee docs: cleanup tables, highlights.scm #42381
highlights.scm: `#match` is slow, prefer `#lua-match`.
2026-10-16 05:49:31 -04:00
Justin M. Keyes 3068a8f652 fix(docs): listitems with codeblocks #42367
Problem:
- `<` before a listitem (`< - foo`) is not concealed.
- Codeblock HTML has extra blank lines.
- Codeblock in a listitem ends the listitem, so HTML docs drop the rest
  of the item and its nesting. Example from `:h nvim_open_win()`:
  ```
        • border: … the double-box style can be specified as: >
          [ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ].
    <
          If fewer than eight chars are given, they will be repeated.
        • bufpos: …

    tree-sitter-vimdoc v4.1.0:
      (block
        (line_li (prefix) (line) (codeblock (code (line)))))
      (block
        (line)                                  ; "If fewer…"
        (line_li (prefix) (line) (line)))       ; "bufpos"

    tree-sitter-vimdoc v4.2.0:
      (block
        (line_li (prefix) (line) (codeblock (code (line)))
          (line))                               ; "If fewer…"
        (line_li (prefix) (line) (line)))       ; "bufpos"
  ```

Solution:
- Bump tree-sitter-vimdoc to v4.2.0. https://github.com/neovim/tree-sitter-vimdoc/pull/174
- gen_help_html: get listitem indent from its first line
- gen_help_html: don't double codeblock newlines.
- highlight query: conceal `<` in `line_li`.
- docs: fix doc sources where a blank line was missing after listitems
  followed by non-listitem text.
2026-10-15 07:03:25 -04:00
Justin M. Keyes d3b606ef3c docs: fix invalid vimdoc #42353 2026-10-14 11:44:49 -04:00
glepnir d51a6e2d55 fix(lua): types for getloclist() signatures #42131
Problem: vim.fn.getloclist() is untyped, unlike getqflist().

Solution: Split it into typed list and {what} forms, like getqflist().
2026-09-28 07:26:34 -04:00
zeertzjqandHirohito Higashi ab7fde41cd vim-patch:5959274: runtime(doc): Tweak documentation style
closes: vim/vim#21361

https://github.com/vim/vim/commit/5959274607038bac22e9dde740060ddb748fedfe

Omit :h :source-dryrun as it needs changes to port to Nvim anyway.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-09-26 08:40:17 +08:00
zeertzjq 409b1bd089 vim-patch:b3a4882: runtime(doc): mention getcellwidths() in setcellwidths()
closes: vim/vim#21362

https://github.com/vim/vim/commit/b3a4882a915634c6031a4b4c8e25d459ac7b4319
2026-09-26 08:40:15 +08:00
Lewis Russell 7e8ad7c52a fix(lua): accept nil nosuf in the expand list overload
The expand() overload required nosuf even though callers can pass nil.
Mark it optional in the source metadata and regenerate the Lua types.

AI-assisted
2026-09-25 17:06:19 +01:00
Lewis Russell affa765b07 fix(lua): generate explicit overloads for vim.fn
The generated vim.fn stubs represent overloads as repeated function
declarations. EmmyLua merges their return types, so getline(lnum) is
inferred as string|string[] even though it always returns a string.

Generate one declaration with @overload annotations from the existing
__N entries, while keeping separate Vimdoc signatures. Parenthesize the
overload return list so types such as (0|-1)[] remain arrays.

Correct getline()'s single-line and range signatures, and add typed
getqflist() signatures for its entry-list and property-query forms. This
lets callers infer quickfix results without local type overrides.

AI-assisted
2026-09-25 10:28:19 +01:00
bfredl 6be4cd6560 refactor(charset)!: delete 'isprint' and cleanup 'iskeyword' and friends
In the `enc=utf-8` only world, the 'isprint' option is quite obsolete.
The function is only consulted for decoded U+0080 to U+00FF chars
whose printability is defined by the unicode charset, just like
higher codepoints. Meanwhile, invalid `\x80` to `\xFF` bytes are always
unprintable.

Disentangle 'iskeyword', 'isfname' and 'isident' from each other by
giving them all separate bitsets. Now these can be updated individually.
These updaters can back out of errors gracefully, no need for extra
panic logic in option[str].c to restore partially updated chartabs.
2026-09-22 12:31:48 +02:00
Justin M. Keyes 6ad6dcd5d4 fix(filetype): empty 'filetype' skips :setfiletype #41958
Problem:
After `:restart` a restored buffer can have an empty 'filetype'. Lazy
LSP setup during the read replays FileType via `:doautoall`, which sets
`did_filetype` even though `filetype=''`.

    :e foo.md
    :restart
    :set ft?  " filetype=

Solution:
Set `did_filetype` only if 'filetype' is non-empty.
2026-09-17 16:56:45 -04:00
Volodymyr Chernetskyi 3f21132a65 vim-patch:9.2.1107: getregionpos() is slow when only the region bounds are needed (#41925)
Problem:  getregionpos() returns a pair of positions for every line, so
          obtaining just the outer endpoints of a region costs O(lines);
          for a 100000 line region that is about 1.4 million list
          allocations for a result of which the caller keeps two
          positions.
Solution: Add a "bounds" item to {opts} that returns a single pair with
          the start on the first line and the end on the last line
          (Volodymyr Chernetskyi).

The lines in between do not influence the outer endpoints, so with
"bounds" they are not visited at all. The two positions then come from
different lines and describe a diagonal of the region rather than its
shape; for a blockwise region they are the start of the first line and
the end of the last line, not the corners of the block.  This is exactly
what indexing the full result gives, so the awkward corners are kept as
they are, including an empty first line yielding a "col" of 0 for the
start while the end keeps its own column.

On a 100000 line buffer this takes getregionpos() from about 45 ms to
about 0.003 ms per call.

closes: vim/vim#21209

https://github.com/vim/vim/commit/2173c3e4eceedc76c4fd7d56cdbfbbd35e9be853
2026-09-15 20:36:32 +08:00
Jan Edmund LazoandHirohito Higashi 594381d758 vim-patch:0ed11ba: runtime(doc): Tweak documentation style a bit
https://github.com/vim/vim/commit/0ed11ba223ec69dfefc8cc5800fb3e0d610fd9f8

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-09-06 23:56:32 -04:00
zeertzjqandYegappan Lakshmanan 797171f45f vim-patch:ca2e65a: runtime(doc): Update quickfix help text with missing information
closes: vim/vim#21229

Supported by AI.

https://github.com/vim/vim/commit/ca2e65a842d93bd6e3f433ce36b55ec450a2bb1a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2026-09-07 08:05:09 +08:00
zeertzjqandEisuke Kawashima 90fc8946e8 vim-patch:fac9e33: runtime(doc): fix example output of cosh (#41609)
closes: vim/vim#21197

https://github.com/vim/vim/commit/fac9e333a8d38e7049e6628e0f5157f4b7c44d2c

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-09-02 13:52:12 +08:00
zeertzjqandHirohito Higashi ec982dfb93 vim-patch:9.2.1004: a completion function cannot tell why it was called (#41500)
Problem:  A function used through 'omnifunc' or 'complete' is called the
          same way whether 'autocomplete' started the completion or a
          key asked for one, so it cannot answer differently.
Solution: Report which of the two it is in complete_info() as "auto". It
          is returned only when asked for in {what}, so what
          complete_info() says by itself does not change
          (Hirohito Higashi).

closes: vim/vim#21143

https://github.com/vim/vim/commit/1f56c351dedad288f79c89b6b6f64be762ec3b9b

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-08-26 07:21:22 +00:00
glepnir 92d5531f96 vim-patch:9.2.1001: complete_info() does not report the item highlight groups (#41461)
Problem:  complete_info() omits "abbr_hlgroup" and "kind_hlgroup".
Solution: Keep the highlight group ID with the match instead of the
          resolved attribute and add both entries to the returned items
          (glepnir).

closes: vim/vim#21105

https://github.com/vim/vim/commit/1c32cede0afdc9351d5887e2f25977d4fb964d9f
2026-08-24 14:35:25 +08:00
zeertzjqandJosep Puigdemont cbe513fca6 vim-patch:63d08d4: runtime(doc): update :h write-plugin and readdir() example
1) The complete example plugin at :h write-plugin the end of the
   documentation didn't reflect the snippets provided during the
   tutorial. In most of the Add() function, interpolated strings are
   used, but the final result used concatenated strings.

2) The example provided in readdir() to get a list of files ending in
   ".txt" didn't properly escape the dot in the regular expression:
      readdir(dirname, {n -> n =~ '.txt$'})
   This would match any file ending with "txt" that is at least 4
   characters long, instead it should be:
      readdir(dirname, {n -> n =~ '\.txt$'})

closes: vim/vim#21123

https://github.com/vim/vim/commit/63d08d43862ed195da78cfb1bebe2c0ed02f80b7

Co-authored-by: Josep Puigdemont <josep.puigdemont@gmail.com>
2026-08-24 08:17:27 +08:00
zeertzjqandHirohito Higashi 12c3e59e6a vim-patch:76f1eed: runtime(doc): clarify how setbufvar() handles window options (#41408)
related: vim/vim#21089
closes:  vim/vim#21104

https://github.com/vim/vim/commit/76f1eed3a5f8fe12a7b01725a99c582a95e69000

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-08-21 09:25:40 +08:00
zeertzjqandChristian Brabandt ecaf9e9396 vim-patch:02bf089: runtime(doc): clarify diff_filler() function (#41283)
fixes: vim/vim#20990

https://github.com/vim/vim/commit/02bf0893d536449548f91b75817748a5e25219c0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-08-12 08:24:48 +08:00
Justin M. Keyes a4a544032a feat(cwd)!: :lcd! (bang), rearrange :bcd/:lcd/… scope precedence #41194
Problem:
- buf-local CWD scope is lower priority than :lcd, which is weird.
  ```
  win > buf > tab > global
  ```
- No way to clear current CWD at a given scope.

Solution:
- Rerrange scope precedence to:
  ```
  buf > win > tab > global
  ```
- Introduce "bang" variants (`:bcd!`/`:lcd!`/`:tcd!`) which clears the
  local CWD for the given scope.
2026-08-07 04:41:37 -04:00
Justin M. Keyes 7d2249c579 docs: misc, :bcd, slug() 2026-08-06 10:27:29 +02:00
Justin M. Keyes 9cd4dd1c19 fix(:bcd): do not "inherit" buffer-local dir
Problem:
Buffer-local CWD (:bcd) is "sticky", similar to window-local CWD (:lcd).
But this contradicts one of its main benefits: per-buffer "project root"
for LSP, OSC7.

Other problems:
- A buffer created with :edit/:enew/:new silently inherits b_localdir
  (and b_prevdir) from the previous buffer.
- curbuf_reusable() refuses to recycle a scratch buffer that has
  `b_localdir`.
- After :new/:vnew/:tabnew the CWD sticks to previous buffer's
  `b_localdir` even though the new curbuf has none, so :new is not
  equivalent to ":split | enew", and getcwd() disagrees with
  haslocaldir().
- Requires "which buffer spawned this buffer" semantics that no other
  buffer-local state has.

Solution:
Drop sticky/inherit behavior of buffer-local CWD (:bcd).

- do_ecmd: always apply the new curbuf's dir (`fix_current_dir`), like
  `do_autochdir` already does. :tabnew from a :bcd buffer now reverts to
  global CWD (and fires DirChanged), same as :tabnew from a :lcd window.
- curbuf_reusable(): recycling a scratch buffer frees its b_localdir.

To get sticky/inherit behavior of CWD, use `:lcd`.
2026-08-04 20:48:44 +02:00
Justin M. Keyes 46ca236525 fix(cwd): validate getcwd(…, -1) 2026-08-04 20:48:44 +02:00
Justin M. Keyes db2e86fba4 refactor(editor): cleanup change-directory (:bcd) logic 2026-08-04 20:48:05 +02:00
saherandJustin M. Keyes ea3868bcf9 feat(editor): :bcd changes buffer-local directory
Problem:
No way to set a buffer-local directory.
Use-cases:
- "Root dir" for LSP (and the "project" concept).
- `:terminal` OSC 7

Solution:
Add `:bcd` command.

- Extend `getcwd()` to take a third arg; `getcwd(-1, -1, bunfr)` returns
  the buffer-local working directory.
- Buffer-local directories have less priority than window-local
  ones, and more priority than tab-local ones.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-08-04 20:09:48 +02:00
glepnir 916a6e9546 fix(eval): complete_info() equal, preselect, commit_chars #41022
Problem:  complete_info() does not report "equal", "preselect" or "commit_chars".

Solution: Report them for the items that set them.
2026-07-28 07:24:58 -04: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
zeertzjqandHirohito Higashi 43b666cb27 vim-patch:770eb7d: runtime(doc): clarify expandcmd() and "~" behaviour
fixes: vim/vim#20793

https://github.com/vim/vim/commit/770eb7db17c44e41fc4eb1975d67f9ec022edb58

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-07-26 09:01:32 +08:00
zeertzjqandChristian Brabandt db41e4c74f vim-patch:0c1a214: runtime(doc): Fix truncated sentence in :h map()
fixes: vim/vim#20725

https://github.com/vim/vim/commit/0c1a214497400a950f1e25f4163215ec930a4659

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-07-25 06:32:03 +08:00
Justin M. Keyes 671e9d4913 feat(marks): :marks completion, list extmarks #40743
Problem:
- No UI for listing extmarks.
- `:marks` doesn't support cmdline-completion.

Solution:
- Add completion and extmarks support to `:marks`.
- Update `get_buf_local_marks` to include the ":" (prompt-buffer) mark.
2026-07-15 05:55:51 -04:00
Justin M. Keyes eb94149a29 refactor(vimscript)!: drop ctxget(), ctxpush(), etc #40724
Problem:
This functions are most likely never used in the wild.
- They are redundant with `nvim_get_context` + `nvim_load_context`.
- The "context" concept was never fully developed and hasn't gained
  traction.

Solution:
Drop these vimscript aliases, they are just extra cruft.
2026-07-13 17:57:13 -04:00
taoandJustin M. Keyes 4a08596314 fix(path): normalize separators (slashes) #39155
Problem:
Continue separators normalization, and try to keep it at the
nvim <-> external boundary, e.g., `fn.xxx`, `api.xxx`, `:xxx`

Solution:
some key changes
- normalize `$HOME-windows`
- normalize entry points of changing directory
  - `nvim_set_current_dir()`, `chdir()`
- normalize the named pipe
  - `--listen` arg, `--server` arg, `:restart`
  - `serverstart()`, `sockconnect()`, `serverstop()`
- make `expand()` respect 'shellslash' again
- clean up `did_set_shellslash`
- replace `forward_slash` with `TO_SLASH`
- remove obsolete `TMP_PATHSEPSTR`
- remove `slash_adjust` in `do_autocmd_dirchanged`?
- make `fnamemodify()` always return `/` (except when substituting
  separators via `:s`, `:gs` ?)

Note:
- these funcs still apply `slash_adjust` on return, as before:
  `:pwd`, `chdir()`, `exepath()`, `getcwd()`
- these funcs alwarys return `/`, unlike before the normalization PRs
  - `getcompletion()`, `finddir()`, `findfile()`

Also
- clean up code, comments, formatting and tests
- move `TO_SLASH` from `f_chdir` to `changedir_func`
- move `TO_SLASH` from `f_bufadd` to `buflist_new`

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-07-12 13:23:44 -04:00
Barrett Ruth 3b88a8a65d fix(filetype): ensure directory bufname ends w/ slash sep #40552
Problem:
`vim.filetype.match()` needs a cheap way to recognize directory buffers
without doing filesystem stat work.

Solution:
Ensure full buffer names for directories end in a trailing slash. Now
directory buffers can proceed through the normal 'filetype' path.

Note side-effects: session and ShaDa buffer-list restore behavior must
be compatible, so those + corresponding tests must be updated.
2026-07-10 12:40:13 -04:00
Barrett Ruth cfd7f29d52 feat(vim.fs): vim.fs.mkdir() #40599
Problem:
`vim.fs` does not provide a directory creation helper matching its
filesystem API shape.

Solution:
Add `vim.fs.mkdir()` as a thin wrapper around `vim.fn.mkdir()`, with
`parents` and `mode` options.
2026-07-08 07:16:29 -04:00
Justin M. Keyes d2073d2eec refactor: cleanup, docs #40480 2026-06-29 13:10:31 -04:00
Justin M. Keyes 8e3b216d0b docs: bufadd(), fnameescape() guidance #40378 2026-06-23 10:08:50 -04:00
glepnirandThomas M Kehrenberg 2e8c60cb38 vim-patch:9.2.0624: C-N/C-P cannot be mapped in complete() completion (#40232)
Problem:  Keys valid in CTRL-X mode are never mapped while insert
          completion is active, so <C-N> and <C-P> cannot be remapped
          for completion started by complete().
Solution: Do not disable mappings in CTRL_X_EVAL mode.  In this mode a
          mapping cannot interfere with selecting the completion
          method, which is what the no-mapping rule exists for.

related: vim/vim#6440
related: vim/vim#16880
closes:  vim/vim#20489

https://github.com/vim/vim/commit/076585e6addb5688f123ef3e174fcfee993b7602

Co-authored-by: Thomas M Kehrenberg <tmke8@posteo.net>
2026-06-14 05:15:07 +00:00
zeertzjqandglepnir 268cd370be vim-patch:595d0a7: runtime(doc): wrong {str} length limit in matchfuzzy() docs (#40157)
Problem:  docs say {str} is capped at 256 and longer returns an empty list.
Solution: it's 1024, and {str} plus each candidate are just truncated to
          that, not rejected; fix the text.

closes: vim/vim#20453

https://github.com/vim/vim/commit/595d0a77e48d02d2865e05d8ea89aa169166b987

Co-authored-by: glepnir <glephunter@gmail.com>
2026-06-10 01:18:26 +00:00
Justin M. Keyes 8f584031bc docs: misc #40126 2026-06-08 16:12:14 -04:00
cbadc4f164 docs: misc, lsp
Problem:
This doc on `vim.lsp.completion.get()`:

    --- Used by the default LSP |omnicompletion| provider |vim.lsp.omnifunc()|, thus |i_CTRL-X_CTRL-O|
    --- invokes this in LSP-enabled buffers. Use CTRL-Y to select an item from the completion menu.
    --- |complete_CTRL-Y|

...makes two wrong claims:

1. "Used by the default LSP omnicompletion provider vim.lsp.omnifunc()"
    - `_omnifunc` does not call `M.get()`, it calls the internal `trigger()` directly.
2. "thus |i_CTRL-X_CTRL-O| invokes this in LSP-enabled buffers"
    - The two paths use different client sets:
        - `M.get()` reads `buf_handles[bufnr].clients` (clients
          explicitly registered via `vim.lsp.completion.enable(true, ...)`).
        - `_omnifunc` reads `lsp.get_clients({method='textDocument/completion'})` (every
          completion client, regardless of `enable()`).

Solution:
Update docs.

Co-authored-by: Koichi Shiraishi <zchee.io@gmail.com>
Co-authored-by: y9san9 / Alex Sokol <y9san9@gmail.com>
Co-authored-by: adv0r <>
2026-06-03 12:27:30 +02:00
zeertzjqandPeter Kenny edcaf1887a vim-patch:partial:9.2.0573: Vim9: missing EX_WHOLE on some block keywords (#40071)
Problem:  Several Vim9 keywords lack EX_WHOLE and can be shortened in
          Vim9 script, inconsistent with endif/enddef/endfor/endwhile/
          endtry which already have it.  The error from :endd in a
          nested function also hardcodes "enddef" instead of reporting
          what the user typed.  fullcommand("ho") returns "horizontal"
          even though :ho is below the documented 3-char minimum.
Solution: Add EX_WHOLE to :class, :def, :endclass, :endinterface,
          :endenum, :public and :static.  In get_function_body() pass
          the user-typed command to the error message.  Force :ho to
          CMD_SIZE in find_ex_command() so fullcommand() reflects the
          modifier minimum.  Extend tests and documentation accordingly
          (Peter Kenny).

fixes:  vim/vim#20032
closes: vim/vim#20191

https://github.com/vim/vim/commit/38d9a16eba8cdf3377e8b867da805bf369454108

Co-authored-by: Peter Kenny <github.com@k1w1.cyou>
2026-06-01 01:04:30 +00:00
Justin M. Keyes e572c9c80a feat(api): tab-local option scope #39811
Problem:
2d795face6 added support for tab-local options ('cmdheight')
to `nvim_get_option_value`, but not to:

    nvim_get_option_info2()
    nvim_set_option_value(…, { tab = … })
    gettabwinvar()

Solution:
- Update `options.lua` to model tab-local options. Introduce `kOptScopeTab`.
- Handle tab scope in the options layer so it works for all options APIs.

Note:
- No change to `gettabvar()`. Not sure if needed/wanted.

fix https://github.com/neovim/neovim/issues/31140
2026-05-17 10:24:46 -04:00
Justin M. Keyes 1f4ad7808e docs: misc, window #39720
- formalize `window-number` similar to `tabpage-number`.
- reference it from docs.
2026-05-10 13:00:52 -04:00
Szymon WilczekandJustin M. Keyes 3639f7a867 feat(server): add v:useractive, use it in serverlist(info=true) #39423
Problem:
When showing the :connect menu, it is useful to know which servers
are most-recently active. But we don't have a good way to detect that.

Solution:
- Introduce `v:useractive`.
- Include this timestamp in `serverlist({info=true})`.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
2026-05-07 10:47:51 -04:00
Justin M. Keyes 662c556a3e docs: rename "tabpage" 2026-05-07 10:36:55 +02:00
Szymon Wilczek c3f803c3b6 feat(server): serverlist({info=true}) gets detailed info #39392
Problem:
UI tools and orchestration engines need more context than just raw
socket addresses from serverlist(). Without knowing if a server belongs
to the current instance or knowing its PID, UIs cannot display
meaningful options to users.

Solution:
- Added the `info=v:true` option to `serverlist()`.
- When `info` is requested, it implies `peer=true` and returns a list of
  dictionaries (defined as `vim.ServerInfo`) with `addr`, `pid` and
  `own`.
- Uses an RPC request to `getpid()` across the socket to fetch the
  peer's actual process ID.

Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
2026-05-06 08:55:34 -04:00